mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-24 09:46:36 +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,
|
||||
serviceName: "pause",
|
||||
isVisible: (stateObj) =>
|
||||
// We need also to check if Start is supported because if not we show play-pause
|
||||
supportsFeature(stateObj, VacuumEntityFeature.START) &&
|
||||
supportsFeature(stateObj, VacuumEntityFeature.PAUSE),
|
||||
// We need also to check if Start is supported because if not we show start-pause
|
||||
// Start-pause service is only available for old vacuum entities, new entities have the `STATE` feature
|
||||
supportsFeature(stateObj, VacuumEntityFeature.PAUSE) &&
|
||||
(supportsFeature(stateObj, VacuumEntityFeature.STATE) ||
|
||||
supportsFeature(stateObj, VacuumEntityFeature.START)),
|
||||
},
|
||||
{
|
||||
translationKey: "start_pause",
|
||||
@ -53,6 +55,8 @@ const VACUUM_COMMANDS: VacuumCommand[] = [
|
||||
serviceName: "start_pause",
|
||||
isVisible: (stateObj) =>
|
||||
// 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.PAUSE),
|
||||
},
|
||||
|
@ -63,6 +63,8 @@ export const VACUUM_COMMANDS_BUTTONS: Record<
|
||||
> = {
|
||||
start_pause: (stateObj) => {
|
||||
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.PAUSE);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user