Skip to content

Commit

Permalink
fix: unique ids
Browse files Browse the repository at this point in the history
  • Loading branch information
sopelj committed Jan 15, 2022
1 parent 341b3b0 commit 7763534
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion custom_components/ember_mug/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,9 @@ def __init__(
device_id: str,
) -> None:
"""Initialize a new temperature sensor."""
self._sensor_type = f"{temp_type} temp"
super().__init__(coordinator, device_id)
self._temp_type = temp_type
self._sensor_type = f"{temp_type} temp"
self._attr_native_unit_of_measurement = temp_unit

@property
Expand All @@ -143,6 +143,7 @@ def extra_state_attributes(self):
class EmberMugBatterySensor(EmberMugSensorBase, SensorEntity):
"""Mug Battery Sensor."""

_sensor_type = "battery"
_attr_device_class = SensorDeviceClass.BATTERY
_attr_native_unit_of_measurement = PERCENTAGE

Expand Down

0 comments on commit 7763534

Please sign in to comment.