Expose mediaLoaded as a conditionState.
This commit is contained in:
@@ -11,6 +11,7 @@ export interface ConditionState {
|
||||
fullscreen?: boolean;
|
||||
camera?: string;
|
||||
state?: HassEntities;
|
||||
mediaLoaded?: boolean;
|
||||
}
|
||||
|
||||
class ConditionStateRequestEvent extends Event {
|
||||
@@ -48,6 +49,10 @@ export function evaluateCondition(
|
||||
state.state[stateTest.entity].state !== stateTest.state_not)));
|
||||
}
|
||||
}
|
||||
if (condition?.mediaLoaded !== undefined) {
|
||||
result &&=
|
||||
state.mediaLoaded !== undefined && condition.mediaLoaded == state.mediaLoaded;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user