mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-27 11:16:35 +00:00
start_pause
is only supported on entities that don't have STATE
sup… (#17147)
* `start_pause` is only support on entities that don't have `STATE` support * Update hui-vacuum-commands-tile-feature.ts * Add comment
This commit is contained in:
parent
04ec380ce0
commit
33b9786ae7
@ -43,9 +43,11 @@ const VACUUM_COMMANDS: VacuumCommand[] = [
|
|||||||
icon: mdiPause,
|
icon: mdiPause,
|
||||||
serviceName: "pause",
|
serviceName: "pause",
|
||||||
isVisible: (stateObj) =>
|
isVisible: (stateObj) =>
|
||||||
// We need also to check if Start is supported because if not we show play-pause
|
// We need also to check if Start is supported because if not we show start-pause
|
||||||
supportsFeature(stateObj, VacuumEntityFeature.START) &&
|
// Start-pause service is only available for old vacuum entities, new entities have the `STATE` feature
|
||||||
supportsFeature(stateObj, VacuumEntityFeature.PAUSE),
|
supportsFeature(stateObj, VacuumEntityFeature.PAUSE) &&
|
||||||
|
(supportsFeature(stateObj, VacuumEntityFeature.STATE) ||
|
||||||
|
supportsFeature(stateObj, VacuumEntityFeature.START)),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
translationKey: "start_pause",
|
translationKey: "start_pause",
|
||||||
@ -53,6 +55,8 @@ const VACUUM_COMMANDS: VacuumCommand[] = [
|
|||||||
serviceName: "start_pause",
|
serviceName: "start_pause",
|
||||||
isVisible: (stateObj) =>
|
isVisible: (stateObj) =>
|
||||||
// If start is supported, we don't show this button
|
// If start is supported, we don't show this button
|
||||||
|
// This service is only available for old vacuum entities, new entities have the `STATE` feature
|
||||||
|
!supportsFeature(stateObj, VacuumEntityFeature.STATE) &&
|
||||||
!supportsFeature(stateObj, VacuumEntityFeature.START) &&
|
!supportsFeature(stateObj, VacuumEntityFeature.START) &&
|
||||||
supportsFeature(stateObj, VacuumEntityFeature.PAUSE),
|
supportsFeature(stateObj, VacuumEntityFeature.PAUSE),
|
||||||
},
|
},
|
||||||
|
@ -63,6 +63,8 @@ export const VACUUM_COMMANDS_BUTTONS: Record<
|
|||||||
> = {
|
> = {
|
||||||
start_pause: (stateObj) => {
|
start_pause: (stateObj) => {
|
||||||
const startPauseOnly =
|
const startPauseOnly =
|
||||||
|
// This service is only available for old vacuum entities, new entities have the `STATE` feature
|
||||||
|
!supportsFeature(stateObj, VacuumEntityFeature.STATE) &&
|
||||||
!supportsFeature(stateObj, VacuumEntityFeature.START) &&
|
!supportsFeature(stateObj, VacuumEntityFeature.START) &&
|
||||||
supportsFeature(stateObj, VacuumEntityFeature.PAUSE);
|
supportsFeature(stateObj, VacuumEntityFeature.PAUSE);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user