Skip to content

Commit

Permalink
Cleanup descriptions
Browse files Browse the repository at this point in the history
This will break uid but be neater to read in the end.
  • Loading branch information
disforw authored Aug 28, 2023
1 parent e726393 commit 61776e1
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions custom_components/eyeonwater/binary_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,45 +29,36 @@ class Description:

FLAG_SENSORS = [
Description(
name="Leak",
key="leak",
translation_key="leak",
device_class=BinarySensorDeviceClass.MOISTURE,
),
Description(
name="EmptyPipe",
key="empty_pipe",
translation_key="emptypipe",
device_class=BinarySensorDeviceClass.PROBLEM,
),
Description(
name="Tamper",
key="tamper",
translation_key="tamper",
device_class=BinarySensorDeviceClass.TAMPER,
),
Description(
name="CoverRemoved",
key="cover_removed",
translation_key="coverremoved",
device_class=BinarySensorDeviceClass.TAMPER,
),
Description(
name="ReverseFlow",
key="reverse_flow",
translation_key="reverseflow",
device_class=BinarySensorDeviceClass.PROBLEM,
),
Description(
name="LowBattery",
key="low_battery",
translation_key="lowbattery",
device_class=BinarySensorDeviceClass.BATTERY,
),
Description(
name="BatteryCharging",
key="battery_charging",
translation_key="batterycharging",
device_class=BinarySensorDeviceClass.BATTERY_CHARGING,
),
]
Expand Down Expand Up @@ -107,7 +98,7 @@ def __init__(
self.meter = meter
self._state = False
self._available = False
self._attr_unique_id = f"{description.name}_{self.meter.meter_uuid}"
self._attr_unique_id = f"{description.key}_{self.meter.meter_uuid}"
self._attr_is_on = self._state
self._attr_device_info = DeviceInfo(
identifiers={(DOMAIN, self.meter.meter_uuid)},
Expand Down

0 comments on commit 61776e1

Please sign in to comment.