Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,14 @@ export class HaTimeCondition extends LitElement implements ConditionElement {
{
name: "after",
selector: inputModeAfter
? { entity: { domain: "input_datetime" } }
? {
entity: {
filter: [
{ domain: "input_datetime" },
{ domain: "sensor", device_class: "timestamp" },
],
},
}
: { time: {} },
},
{
Expand All @@ -88,7 +95,14 @@ export class HaTimeCondition extends LitElement implements ConditionElement {
{
name: "before",
selector: inputModeBefore
? { entity: { domain: "input_datetime" } }
? {
entity: {
filter: [
{ domain: "input_datetime" },
{ domain: "sensor", device_class: "timestamp" },
],
},
}
: { time: {} },
},
{
Expand All @@ -111,10 +125,12 @@ export class HaTimeCondition extends LitElement implements ConditionElement {
protected render() {
const inputModeBefore =
this._inputModeBefore ??
this.condition.before?.startsWith("input_datetime.");
(this.condition.before?.startsWith("input_datetime.") ||
this.condition.before?.startsWith("sensor."));
const inputModeAfter =
this._inputModeAfter ??
this.condition.after?.startsWith("input_datetime.");
(this.condition.after?.startsWith("input_datetime.") ||
this.condition.after?.startsWith("sensor."));

const schema = this._schema(
this.hass.localize,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,14 @@ export class HaTimeTrigger extends LitElement implements TriggerElement {
private _schema = memoizeOne(
(localize: LocalizeFunc, inputMode?: boolean) => {
const atSelector = inputMode
? { entity: { domain: "input_datetime" } }
? {
entity: {
filter: [
{ domain: "input_datetime" },
{ domain: "sensor", device_class: "timestamp" },
],
},
}
: { time: {} };

return [
Expand Down
2 changes: 1 addition & 1 deletion src/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -2130,7 +2130,7 @@
},
"time": {
"type_value": "Fixed time",
"type_input": "Value of a date/time helper",
"type_input": "Value of a date/time helper or timestamp-class sensor",
"label": "Time",
"at": "At time",
"mode": "Mode"
Expand Down