mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 11:17:21 +00:00
Small cleanups to gogogate2 (#64935)
This commit is contained in:
parent
5cc5813bd6
commit
50cc5e10b9
@ -66,6 +66,9 @@ class DoorSensorBattery(DoorSensorEntity):
|
|||||||
"""Battery sensor entity for gogogate2 door sensor."""
|
"""Battery sensor entity for gogogate2 door sensor."""
|
||||||
|
|
||||||
_attr_entity_category = EntityCategory.DIAGNOSTIC
|
_attr_entity_category = EntityCategory.DIAGNOSTIC
|
||||||
|
_attr_device_class = SensorDeviceClass.BATTERY
|
||||||
|
_attr_state_class = SensorStateClass.MEASUREMENT
|
||||||
|
_attr_native_unit_of_measurement = PERCENTAGE
|
||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
@ -76,9 +79,6 @@ class DoorSensorBattery(DoorSensorEntity):
|
|||||||
"""Initialize the object."""
|
"""Initialize the object."""
|
||||||
unique_id = sensor_unique_id(config_entry, door, "battery")
|
unique_id = sensor_unique_id(config_entry, door, "battery")
|
||||||
super().__init__(config_entry, data_update_coordinator, door, unique_id)
|
super().__init__(config_entry, data_update_coordinator, door, unique_id)
|
||||||
self._attr_device_class = SensorDeviceClass.BATTERY
|
|
||||||
self._attr_state_class = SensorStateClass.MEASUREMENT
|
|
||||||
self._attr_native_unit_of_measurement = PERCENTAGE
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def name(self):
|
def name(self):
|
||||||
@ -94,6 +94,10 @@ class DoorSensorBattery(DoorSensorEntity):
|
|||||||
class DoorSensorTemperature(DoorSensorEntity):
|
class DoorSensorTemperature(DoorSensorEntity):
|
||||||
"""Temperature sensor entity for gogogate2 door sensor."""
|
"""Temperature sensor entity for gogogate2 door sensor."""
|
||||||
|
|
||||||
|
_attr_device_class = SensorDeviceClass.TEMPERATURE
|
||||||
|
_attr_state_class = SensorStateClass.MEASUREMENT
|
||||||
|
_attr_native_unit_of_measurement = TEMP_CELSIUS
|
||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
config_entry: ConfigEntry,
|
config_entry: ConfigEntry,
|
||||||
@ -103,9 +107,6 @@ class DoorSensorTemperature(DoorSensorEntity):
|
|||||||
"""Initialize the object."""
|
"""Initialize the object."""
|
||||||
unique_id = sensor_unique_id(config_entry, door, "temperature")
|
unique_id = sensor_unique_id(config_entry, door, "temperature")
|
||||||
super().__init__(config_entry, data_update_coordinator, door, unique_id)
|
super().__init__(config_entry, data_update_coordinator, door, unique_id)
|
||||||
self._attr_device_class = SensorDeviceClass.TEMPERATURE
|
|
||||||
self._attr_state_class = SensorStateClass.MEASUREMENT
|
|
||||||
self._attr_native_unit_of_measurement = TEMP_CELSIUS
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def name(self):
|
def name(self):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user