Flag enums as enums with option list #35

This commit is contained in:
Andre Basche 2023-05-07 02:34:41 +02:00
parent c0fda4cd1b
commit 7e40afae68

View file

@ -34,7 +34,34 @@ SENSORS: dict[str, tuple[SensorEntityDescription, ...]] = {
key="prPhase", key="prPhase",
name="Program Phase", name="Program Phase",
icon="mdi:washing-machine", icon="mdi:washing-machine",
device_class=SensorDeviceClass.ENUM,
translation_key="program_phases_wm", translation_key="program_phases_wm",
options=[
"0",
"1",
"2",
"3",
"4",
"5",
"6",
"7",
"9",
"10",
"11",
"12",
"13",
"14",
"15",
"16",
"17",
"18",
"19",
"20",
"24",
"25",
"26",
"27",
],
), ),
SensorEntityDescription( SensorEntityDescription(
key="totalElectricityUsed", key="totalElectricityUsed",
@ -88,7 +115,9 @@ SENSORS: dict[str, tuple[SensorEntityDescription, ...]] = {
key="machMode", key="machMode",
name="Machine Status", name="Machine Status",
icon="mdi:information", icon="mdi:information",
device_class=SensorDeviceClass.ENUM,
translation_key="washing_modes", translation_key="washing_modes",
options=["0", "1", "3", "4", "5", "6", "7"],
), ),
SensorEntityDescription( SensorEntityDescription(
key="errors", name="Error", icon="mdi:math-log", translation_key="errors" key="errors", name="Error", icon="mdi:math-log", translation_key="errors"
@ -161,7 +190,9 @@ SENSORS: dict[str, tuple[SensorEntityDescription, ...]] = {
key="machMode", key="machMode",
name="Machine Status", name="Machine Status",
icon="mdi:information", icon="mdi:information",
device_class=SensorDeviceClass.ENUM,
translation_key="washing_modes", translation_key="washing_modes",
options=["0", "1", "3", "4", "5", "6", "7"],
), ),
SensorEntityDescription( SensorEntityDescription(
key="errors", name="Error", icon="mdi:math-log", translation_key="errors" key="errors", name="Error", icon="mdi:math-log", translation_key="errors"
@ -192,13 +223,29 @@ SENSORS: dict[str, tuple[SensorEntityDescription, ...]] = {
key="prPhase", key="prPhase",
name="Program Phase", name="Program Phase",
icon="mdi:washing-machine", icon="mdi:washing-machine",
device_class=SensorDeviceClass.ENUM,
translation_key="program_phases_td", translation_key="program_phases_td",
options=[
"0",
"1",
"2",
"3",
"13",
"14",
"15",
"16",
"18",
"19",
"20",
],
), ),
SensorEntityDescription( SensorEntityDescription(
key="dryLevel", key="dryLevel",
name="Dry level", name="Dry level",
icon="mdi:hair-dryer", icon="mdi:hair-dryer",
device_class=SensorDeviceClass.ENUM,
translation_key="dry_levels", translation_key="dry_levels",
options=["0", "1", "2", "3", "4", "12", "13", "14", "15"],
), ),
SensorEntityDescription( SensorEntityDescription(
key="tempLevel", key="tempLevel",
@ -290,7 +337,9 @@ SENSORS: dict[str, tuple[SensorEntityDescription, ...]] = {
key="machMode", key="machMode",
name="Machine Status", name="Machine Status",
icon="mdi:information", icon="mdi:information",
device_class=SensorDeviceClass.ENUM,
translation_key="washing_modes", translation_key="washing_modes",
options=["0", "1", "3", "4", "5", "6", "7"],
), ),
SensorEntityDescription( SensorEntityDescription(
key="spinSpeed", key="spinSpeed",
@ -318,7 +367,34 @@ SENSORS: dict[str, tuple[SensorEntityDescription, ...]] = {
key="prPhase", key="prPhase",
name="Program Phase", name="Program Phase",
icon="mdi:washing-machine", icon="mdi:washing-machine",
device_class=SensorDeviceClass.ENUM,
translation_key="program_phases_wm", translation_key="program_phases_wm",
options=[
"0",
"1",
"2",
"3",
"4",
"5",
"6",
"7",
"9",
"10",
"11",
"12",
"13",
"14",
"15",
"16",
"17",
"18",
"19",
"20",
"24",
"25",
"26",
"27",
],
), ),
SensorEntityDescription( SensorEntityDescription(
key="dryLevel", key="dryLevel",
@ -458,7 +534,9 @@ SENSORS: dict[str, tuple[SensorEntityDescription, ...]] = {
key="machMode", key="machMode",
name="Machine Status", name="Machine Status",
icon="mdi:information", icon="mdi:information",
device_class=SensorDeviceClass.ENUM,
translation_key="washing_modes", translation_key="washing_modes",
options=["0", "1", "3", "4", "5", "6", "7"],
), ),
SensorEntityDescription( SensorEntityDescription(
key="errors", name="Error", icon="mdi:math-log", translation_key="errors" key="errors", name="Error", icon="mdi:math-log", translation_key="errors"
@ -475,7 +553,9 @@ SENSORS: dict[str, tuple[SensorEntityDescription, ...]] = {
key="prPhase", key="prPhase",
name="Program Phase", name="Program Phase",
icon="mdi:washing-machine", icon="mdi:washing-machine",
device_class=SensorDeviceClass.ENUM,
translation_key="program_phases_dw", translation_key="program_phases_dw",
options=["0", "1", "2", "3", "4", "5", "6"],
), ),
), ),
} }