mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-24 09:46:36 +00:00
Remove alarm modes list when adding a alarm modes card feature (#20688)
This commit is contained in:
parent
649917cdde
commit
12a61a0021
@ -13,17 +13,17 @@ import "../../../components/ha-control-select";
|
||||
import type { ControlSelectOption } from "../../../components/ha-control-select";
|
||||
import "../../../components/ha-control-slider";
|
||||
import {
|
||||
ALARM_MODES,
|
||||
AlarmControlPanelEntity,
|
||||
AlarmMode,
|
||||
ALARM_MODES,
|
||||
supportedAlarmModes,
|
||||
} from "../../../data/alarm_control_panel";
|
||||
import { UNAVAILABLE } from "../../../data/entity";
|
||||
import { showEnterCodeDialog } from "../../../dialogs/enter-code/show-enter-code-dialog";
|
||||
import { HomeAssistant } from "../../../types";
|
||||
import { LovelaceCardFeature, LovelaceCardFeatureEditor } from "../types";
|
||||
import { AlarmModesCardFeatureConfig } from "./types";
|
||||
import { showEnterCodeDialog } from "../../../dialogs/enter-code/show-enter-code-dialog";
|
||||
import { filterModes } from "./common/filter-modes";
|
||||
import { AlarmModesCardFeatureConfig } from "./types";
|
||||
|
||||
export const supportsAlarmModesCardFeature = (stateObj: HassEntity) => {
|
||||
const domain = computeDomain(stateObj.entity_id);
|
||||
@ -43,15 +43,9 @@ class HuiAlarmModeCardFeature
|
||||
|
||||
@state() _currentMode?: AlarmMode;
|
||||
|
||||
static getStubConfig(_, stateObj?: HassEntity): AlarmModesCardFeatureConfig {
|
||||
static getStubConfig(): AlarmModesCardFeatureConfig {
|
||||
return {
|
||||
type: "alarm-modes",
|
||||
modes: stateObj
|
||||
? (Object.keys(ALARM_MODES) as AlarmMode[]).filter((mode) => {
|
||||
const feature = ALARM_MODES[mode as AlarmMode].feature;
|
||||
return !feature || supportsFeature(stateObj, feature);
|
||||
})
|
||||
: [],
|
||||
};
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user