189 files
This commit is contained in:
@@ -17,5 +17,5 @@
|
||||
"iot_class": "calculated",
|
||||
"issue_tracker": "https://github.com/tempus2016/taskmate/issues",
|
||||
"requirements": [],
|
||||
"version": "5.4.3"
|
||||
"version": "5.5.0"
|
||||
}
|
||||
|
||||
@@ -265,6 +265,7 @@
|
||||
"child.editor.time_category": "Zeitkategorie",
|
||||
"child.editor.time_category_afternoon": "Nachmittagsaufgaben",
|
||||
"child.editor.time_category_all": "Heutige Aufgaben (Alle)",
|
||||
"child.editor.time_category_current": "Aktueller Zeitabschnitt (live)",
|
||||
"child.editor.time_category_anytime": "Heutige Aufgaben (jederzeit)",
|
||||
"child.editor.time_category_evening": "Abendliche Aufgaben",
|
||||
"child.editor.time_category_helper": "Zu welcher Tageszeit Aufgaben angezeigt werden sollen – legt auch den Kartentitel fest",
|
||||
@@ -1758,5 +1759,7 @@
|
||||
"child.editor.pre_reader": "Nur-Bilder-Modus (für kleine Kinder)",
|
||||
"child.editor.pre_reader_labels": "Namen im Bildmodus anzeigen",
|
||||
"child.editor.pre_reader_points": "Punktzahl statt Sterne im Bildmodus anzeigen",
|
||||
"common.design.accessible": "Barrierefrei"
|
||||
"common.design.accessible": "Barrierefrei",
|
||||
"child.editor.include_anytime_chores": "Jederzeit-Aufgaben einbeziehen",
|
||||
"child.editor.include_anytime_chores_helper": "Jederzeit-Aufgaben erscheinen normalerweise in jeder Zeitkategorie – deaktivieren, um sie auszublenden"
|
||||
}
|
||||
|
||||
@@ -267,6 +267,7 @@
|
||||
"child.editor.time_category": "Time Category",
|
||||
"child.editor.time_category_afternoon": "Afternoon Chores",
|
||||
"child.editor.time_category_all": "Today's Chores (All)",
|
||||
"child.editor.time_category_current": "Current Time Period (Live)",
|
||||
"child.editor.time_category_anytime": "Today's Chores (Anytime)",
|
||||
"child.editor.time_category_evening": "Evening Chores",
|
||||
"child.editor.time_category_helper": "Which time of day to show chores for — also sets the card title",
|
||||
@@ -1758,5 +1759,7 @@
|
||||
"child.editor.pre_reader": "Picture-only mode (for young children)",
|
||||
"child.editor.pre_reader_labels": "Show names in picture mode",
|
||||
"child.editor.pre_reader_points": "Show point values instead of stars in picture mode",
|
||||
"common.design.accessible": "Accessible"
|
||||
"common.design.accessible": "Accessible",
|
||||
"child.editor.include_anytime_chores": "Include anytime chores",
|
||||
"child.editor.include_anytime_chores_helper": "Anytime chores normally appear under every time category — turn this off to hide them"
|
||||
}
|
||||
|
||||
@@ -267,6 +267,7 @@
|
||||
"child.editor.time_category": "Time Category",
|
||||
"child.editor.time_category_afternoon": "Afternoon Chores",
|
||||
"child.editor.time_category_all": "Today's Chores (All)",
|
||||
"child.editor.time_category_current": "Current Time Period (Live)",
|
||||
"child.editor.time_category_anytime": "Today's Chores (Anytime)",
|
||||
"child.editor.time_category_evening": "Evening Chores",
|
||||
"child.editor.time_category_helper": "Which time of day to show chores for — also sets the card title",
|
||||
@@ -1758,5 +1759,7 @@
|
||||
"child.editor.pre_reader": "Picture-only mode (for young children)",
|
||||
"child.editor.pre_reader_labels": "Show names in picture mode",
|
||||
"child.editor.pre_reader_points": "Show point values instead of stars in picture mode",
|
||||
"common.design.accessible": "Accessible"
|
||||
"common.design.accessible": "Accessible",
|
||||
"child.editor.include_anytime_chores": "Include anytime chores",
|
||||
"child.editor.include_anytime_chores_helper": "Anytime chores normally appear under every time category — turn this off to hide them"
|
||||
}
|
||||
|
||||
@@ -265,6 +265,7 @@
|
||||
"child.editor.time_category": "Catégorie de temps",
|
||||
"child.editor.time_category_afternoon": "Tâches de l'après-midi",
|
||||
"child.editor.time_category_all": "Tâches d'aujourd'hui (toutes)",
|
||||
"child.editor.time_category_current": "Période actuelle (en direct)",
|
||||
"child.editor.time_category_anytime": "Tâches d'aujourd'hui (n'importe quand)",
|
||||
"child.editor.time_category_evening": "Tâches du soir",
|
||||
"child.editor.time_category_helper": "Pour quel moment de la journée afficher les tâches — définit également le titre de la carte",
|
||||
@@ -1758,5 +1759,7 @@
|
||||
"child.editor.pre_reader": "Mode images seules (jeunes enfants)",
|
||||
"child.editor.pre_reader_labels": "Afficher les noms en mode images",
|
||||
"child.editor.pre_reader_points": "Afficher les points au lieu des étoiles en mode images",
|
||||
"common.design.accessible": "Accessible"
|
||||
"common.design.accessible": "Accessible",
|
||||
"child.editor.include_anytime_chores": "Inclure les tâches « n'importe quand »",
|
||||
"child.editor.include_anytime_chores_helper": "Les tâches « n'importe quand » apparaissent normalement dans toutes les catégories de temps — désactivez pour les masquer"
|
||||
}
|
||||
|
||||
@@ -265,6 +265,7 @@
|
||||
"child.editor.time_category": "Tidskategori",
|
||||
"child.editor.time_category_afternoon": "Ettermiddagsoppgaver",
|
||||
"child.editor.time_category_all": "Dagens oppgaver (alle)",
|
||||
"child.editor.time_category_current": "Gjeldende tidsperiode (live)",
|
||||
"child.editor.time_category_anytime": "Dagens oppgaver (når som helst)",
|
||||
"child.editor.time_category_evening": "Kveldsoppgaver",
|
||||
"child.editor.time_category_helper": "Hvilken tid på dagen skal oppgaver vises — setter også korttittelen",
|
||||
@@ -1758,5 +1759,7 @@
|
||||
"child.editor.pre_reader": "Kun bilder (for små barn)",
|
||||
"child.editor.pre_reader_labels": "Vis navn i bildemodus",
|
||||
"child.editor.pre_reader_points": "Vis poengverdier i stedet for stjerner i bildemodus",
|
||||
"common.design.accessible": "Tilgjengelig"
|
||||
"common.design.accessible": "Tilgjengelig",
|
||||
"child.editor.include_anytime_chores": "Ta med «når som helst»-oppgaver",
|
||||
"child.editor.include_anytime_chores_helper": "«Når som helst»-oppgaver vises normalt i alle tidskategorier — slå av for å skjule dem"
|
||||
}
|
||||
|
||||
@@ -265,6 +265,7 @@
|
||||
"child.editor.time_category": "Tidskategori",
|
||||
"child.editor.time_category_afternoon": "Ettermiddagsoppgåver",
|
||||
"child.editor.time_category_all": "Dagens oppgåver (alle)",
|
||||
"child.editor.time_category_current": "Gjeldande tidsperiode (live)",
|
||||
"child.editor.time_category_anytime": "Dagens oppgåver (kva tid som helst)",
|
||||
"child.editor.time_category_evening": "Kveldsoppgåver",
|
||||
"child.editor.time_category_helper": "Kva tid på dagen oppgåver skal visast — set òg korttittelen",
|
||||
@@ -1758,5 +1759,7 @@
|
||||
"child.editor.pre_reader": "Berre bilete (for små born)",
|
||||
"child.editor.pre_reader_labels": "Vis namn i biletemodus",
|
||||
"child.editor.pre_reader_points": "Vis poengverdiar i staden for stjerner i biletemodus",
|
||||
"common.design.accessible": "Tilgjengeleg"
|
||||
"common.design.accessible": "Tilgjengeleg",
|
||||
"child.editor.include_anytime_chores": "Ta med «kva tid som helst»-oppgåver",
|
||||
"child.editor.include_anytime_chores_helper": "«Kva tid som helst»-oppgåver vert normalt viste i alle tidskategoriar — slå av for å skjule dei"
|
||||
}
|
||||
|
||||
@@ -265,6 +265,7 @@
|
||||
"child.editor.time_category": "Categoria de Hora",
|
||||
"child.editor.time_category_afternoon": "Tarefas da Tarde",
|
||||
"child.editor.time_category_all": "Tarefas de Hoje (Todas)",
|
||||
"child.editor.time_category_current": "Período Atual (Ao Vivo)",
|
||||
"child.editor.time_category_anytime": "Tarefas de Hoje (Qualquer Hora)",
|
||||
"child.editor.time_category_evening": "Tarefas da Noite",
|
||||
"child.editor.time_category_helper": "Qual período do dia mostrar tarefas — também define o título do cartão",
|
||||
@@ -1758,5 +1759,7 @@
|
||||
"child.editor.pre_reader": "Modo só imagens (crianças pequenas)",
|
||||
"child.editor.pre_reader_labels": "Mostrar nomes no modo imagens",
|
||||
"child.editor.pre_reader_points": "Mostrar pontos em vez de estrelas no modo imagens",
|
||||
"common.design.accessible": "Acessível"
|
||||
"common.design.accessible": "Acessível",
|
||||
"child.editor.include_anytime_chores": "Incluir tarefas de qualquer hora",
|
||||
"child.editor.include_anytime_chores_helper": "As tarefas de qualquer hora aparecem normalmente em todas as categorias de hora — desative para ocultá-las"
|
||||
}
|
||||
|
||||
@@ -265,6 +265,7 @@
|
||||
"child.editor.time_category": "Categoria de Hora",
|
||||
"child.editor.time_category_afternoon": "Tarefas da Tarde",
|
||||
"child.editor.time_category_all": "Tarefas de Hoje (Todas)",
|
||||
"child.editor.time_category_current": "Período Atual (Ao Vivo)",
|
||||
"child.editor.time_category_anytime": "Tarefas de Hoje (Qualquer Hora)",
|
||||
"child.editor.time_category_evening": "Tarefas da Noite",
|
||||
"child.editor.time_category_helper": "Qual período do dia mostrar tarefas — também define o título do cartão",
|
||||
@@ -1758,5 +1759,7 @@
|
||||
"child.editor.pre_reader": "Modo só imagens (crianças pequenas)",
|
||||
"child.editor.pre_reader_labels": "Mostrar nomes no modo imagens",
|
||||
"child.editor.pre_reader_points": "Mostrar pontos em vez de estrelas no modo imagens",
|
||||
"common.design.accessible": "Acessível"
|
||||
"common.design.accessible": "Acessível",
|
||||
"child.editor.include_anytime_chores": "Incluir tarefas de qualquer hora",
|
||||
"child.editor.include_anytime_chores_helper": "As tarefas de qualquer hora aparecem normalmente em todas as categorias de hora — desative para as ocultar"
|
||||
}
|
||||
|
||||
@@ -2228,6 +2228,7 @@ class TaskMateChildCard extends LitElement {
|
||||
}
|
||||
this.config = {
|
||||
time_category: "anytime",
|
||||
include_anytime_chores: true, // false hides the Anytime bucket from every filter
|
||||
debug: false,
|
||||
default_sound: "coin",
|
||||
undo_sound: "undo",
|
||||
@@ -2449,7 +2450,7 @@ class TaskMateChildCard extends LitElement {
|
||||
? this._renderEmptyState()
|
||||
: html`
|
||||
<div class="section-title">
|
||||
<ha-icon icon="${this._getTimeCategoryIcon(this.config.time_category)}"></ha-icon>
|
||||
<ha-icon icon="${this._getTimeCategoryIcon(this._effectiveTimeCategory())}"></ha-icon>
|
||||
<span class="section-title-text">${this._getDynamicTitle()}</span>
|
||||
${this.config.show_countdown !== false ? (() => {
|
||||
const countdown = this._getMidnightCountdown();
|
||||
@@ -3068,6 +3069,10 @@ class TaskMateChildCard extends LitElement {
|
||||
// or a sensor that hasn't published yet) has to read as available, or the
|
||||
// card would blank itself.
|
||||
const availability = attrs.chore_availability || {};
|
||||
// "current" resolves to the live period; anytime chores are opt-out (#847).
|
||||
const isCurrentMode = this.config.time_category === 'current';
|
||||
const effectiveCategory = this._effectiveTimeCategory();
|
||||
const includeAnytime = this.config.include_anytime_chores !== false;
|
||||
|
||||
// First, filter chores for this child and time category
|
||||
const filteredChores = chores.filter(chore => {
|
||||
@@ -3076,18 +3081,30 @@ class TaskMateChildCard extends LitElement {
|
||||
const disabledFor = chore.disabled_for || [];
|
||||
if (disabledFor.includes(childId)) return false;
|
||||
|
||||
// Anytime chores match every filter, so opting out has to be an early
|
||||
// return: _isChoreInClaimWindow() reports "anytime" as always in-window,
|
||||
// and a clause inside matchesCardFilter would be bypassed below.
|
||||
if (!includeAnytime && chore.time_category === "anytime") return false;
|
||||
|
||||
// Check time category. The card's configured filter matches as before;
|
||||
// on top of that, chores currently in their claim window (including the
|
||||
// post-period grace) and any future-period chores are let through so
|
||||
// they can render as locked previews or keep claimable during grace.
|
||||
const isLockedPreview = this._isChorePreviewLocked(chore);
|
||||
const inClaimWindow = this._isChoreInClaimWindow(chore);
|
||||
chore._isLockedPreview = isLockedPreview;
|
||||
// In "current" mode a future chore must not survive as a dimmed preview
|
||||
// either, so the flag is cleared rather than just filtered around.
|
||||
chore._isLockedPreview = isCurrentMode ? false : isLockedPreview;
|
||||
const matchesCardFilter =
|
||||
this.config.time_category === "all" ||
|
||||
chore.time_category === this.config.time_category ||
|
||||
effectiveCategory === "all" ||
|
||||
chore.time_category === effectiveCategory ||
|
||||
chore.time_category === "anytime";
|
||||
const matchesTime = matchesCardFilter || isLockedPreview || inClaimWindow;
|
||||
// "current" drops the future-preview pass-through; the claim window stays
|
||||
// so a chore inside its post-period grace is still tappable, and past
|
||||
// periods keep being governed by elapsed_time_mode.
|
||||
const matchesTime = isCurrentMode
|
||||
? matchesCardFilter || inClaimWindow
|
||||
: matchesCardFilter || isLockedPreview || inClaimWindow;
|
||||
|
||||
// Check assignment
|
||||
let assignedTo = chore.assigned_to;
|
||||
@@ -3320,6 +3337,16 @@ class TaskMateChildCard extends LitElement {
|
||||
});
|
||||
}
|
||||
|
||||
// Resolves the configured time_category. "current" is dynamic: it tracks
|
||||
// whichever period is active right now, so a wall dashboard shows only the
|
||||
// chores that are actually due (#847). Everything else passes through.
|
||||
// _getCurrentTimePeriod() reads the user's own time_periods, so custom
|
||||
// periods work here without any extra mapping.
|
||||
_effectiveTimeCategory() {
|
||||
const configured = this.config?.time_category;
|
||||
return configured === 'current' ? this._getCurrentTimePeriod() : configured;
|
||||
}
|
||||
|
||||
_getTimeCategoryIcon(category) {
|
||||
const period = this._getTimePeriods().find(p => p.id === category);
|
||||
if (period) return period.icon;
|
||||
@@ -3349,7 +3376,7 @@ class TaskMateChildCard extends LitElement {
|
||||
}
|
||||
|
||||
_getDynamicTitle() {
|
||||
const category = this.config.time_category;
|
||||
const category = this._effectiveTimeCategory();
|
||||
const period = this._getTimePeriods().find(p => p.id === category);
|
||||
if (period && period.label) return period.label;
|
||||
const keyMap = {
|
||||
@@ -4866,6 +4893,7 @@ class TaskMateChildCardEditor extends LitElement {
|
||||
}))
|
||||
: Object.entries(builtinLabels).map(([value, label]) => ({ value, label }));
|
||||
return [
|
||||
{ value: 'current', label: this._t('child.editor.time_category_current') },
|
||||
...periodOptions,
|
||||
{ value: 'anytime', label: this._t('child.editor.time_category_anytime') },
|
||||
{ value: 'all', label: this._t('child.editor.time_category_all') },
|
||||
@@ -4977,6 +5005,7 @@ class TaskMateChildCardEditor extends LitElement {
|
||||
},
|
||||
},
|
||||
},
|
||||
{ name: 'include_anytime_chores', selector: { boolean: {} } },
|
||||
{ name: 'show_countdown', selector: { boolean: {} } },
|
||||
{ name: 'show_description', selector: { boolean: {} } },
|
||||
{ name: 'pre_reader', selector: { boolean: {} } },
|
||||
@@ -4997,6 +5026,7 @@ class TaskMateChildCardEditor extends LitElement {
|
||||
first_come_claimed_mode: this._t('child.editor.first_come_when_completed'),
|
||||
dependency_mode: this._t('child.editor.dependency_mode'),
|
||||
elapsed_time_mode: this._t('child.editor.missed_time_chores'),
|
||||
include_anytime_chores: this._t('child.editor.include_anytime_chores'),
|
||||
show_countdown: this._t('child.editor.show_countdown'),
|
||||
show_description: this._t('child.editor.show_description'),
|
||||
pre_reader: this._t('child.editor.pre_reader'),
|
||||
@@ -5017,6 +5047,7 @@ class TaskMateChildCardEditor extends LitElement {
|
||||
first_come_claimed_mode: this._t('child.editor.first_come_helper'),
|
||||
dependency_mode: this._t('child.editor.dependency_helper'),
|
||||
elapsed_time_mode: this._t('child.editor.elapsed_helper'),
|
||||
include_anytime_chores: this._t('child.editor.include_anytime_chores_helper'),
|
||||
};
|
||||
return helpers[entry.name] ?? '';
|
||||
};
|
||||
@@ -5034,6 +5065,7 @@ class TaskMateChildCardEditor extends LitElement {
|
||||
first_come_claimed_mode: this.config.first_come_claimed_mode || 'hide',
|
||||
dependency_mode: this.config.dependency_mode || 'hide',
|
||||
elapsed_time_mode: this.config.elapsed_time_mode || 'dim',
|
||||
include_anytime_chores: this.config.include_anytime_chores !== false,
|
||||
show_countdown: this.config.show_countdown !== false,
|
||||
show_description: this.config.show_description === true,
|
||||
pre_reader: this.config.pre_reader === true,
|
||||
|
||||
Reference in New Issue
Block a user