Sensor should reflect zone name in addition to just an id
Closed this issue · 1 comments
GeoffAtHome commented
Currently sensors such as battery levels just reflect the id of the device. If this included the zone name it would make it more useful.
In sensor.py
I suggest the code is changed from:
class GeniusBattery(GeniusDevice, SensorEntity):
"""Representation of a Genius Hub sensor."""
def __init__(self, broker, device, state_attr) -> None:
"""Initialize the sensor."""
super().__init__(broker, device)
self._state_attr = state_attr
self._attr_name = f"{device.type} {device.id}"
to:
class GeniusBattery(GeniusDevice, SensorEntity):
"""Representation of a Genius Hub sensor."""
def __init__(self, broker, device, state_attr) -> None:
"""Initialize the sensor."""
super().__init__(broker, device)
self._state_attr = state_attr
self._attr_name = f"{device.type} ({device.id}) in {device.assigned_zone.name}"
from
GeoffAtHome commented
Added to home assistant core.