mirror of
https://github.com/DigiLive/mushroom-strategy.git
synced 2025-09-25 12:50:54 +02:00
Apply fd1a09c
The branch is rebased onto `main` branch. At `main`, badges where still called chips. Changes to `SwitchChip.ts` are applies to `SwitchBadge.ts` in this commit.
This commit is contained in:
@@ -4,6 +4,7 @@ import { Registry } from '../Registry';
|
|||||||
import RegistryFilter from '../utilities/RegistryFilter';
|
import RegistryFilter from '../utilities/RegistryFilter';
|
||||||
import AbstractBadge from './AbstractBadge';
|
import AbstractBadge from './AbstractBadge';
|
||||||
import { LovelaceBadgeConfig } from '../types/homeassistant/data/lovelace/config/badge';
|
import { LovelaceBadgeConfig } from '../types/homeassistant/data/lovelace/config/badge';
|
||||||
|
import { localize } from '../utilities/localize';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Switch Badge class.
|
* Switch Badge class.
|
||||||
@@ -31,6 +32,9 @@ class SwitchBadge extends AbstractBadge {
|
|||||||
content: Registry.getCountTemplate('switch', 'eq', 'on'),
|
content: Registry.getCountTemplate('switch', 'eq', 'on'),
|
||||||
tap_action: {
|
tap_action: {
|
||||||
action: 'perform-action',
|
action: 'perform-action',
|
||||||
|
confirmation: {
|
||||||
|
text: localize('switch.chip_confirmation'),
|
||||||
|
},
|
||||||
perform_action: 'switch.turn_off',
|
perform_action: 'switch.turn_off',
|
||||||
target: {
|
target: {
|
||||||
entity_id: new RegistryFilter(Registry.entities)
|
entity_id: new RegistryFilter(Registry.entities)
|
||||||
|
Reference in New Issue
Block a user