mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 05:07:41 +00:00
Collection of DeviceClass related typing fixes (#82931)
This commit is contained in:
parent
2785b2b52f
commit
368694d6bf
@ -8,6 +8,7 @@ import voluptuous as vol
|
|||||||
from homeassistant.components.binary_sensor import (
|
from homeassistant.components.binary_sensor import (
|
||||||
DEVICE_CLASSES_SCHEMA,
|
DEVICE_CLASSES_SCHEMA,
|
||||||
PLATFORM_SCHEMA,
|
PLATFORM_SCHEMA,
|
||||||
|
BinarySensorDeviceClass,
|
||||||
BinarySensorEntity,
|
BinarySensorEntity,
|
||||||
)
|
)
|
||||||
from homeassistant.const import (
|
from homeassistant.const import (
|
||||||
@ -64,7 +65,7 @@ def setup_platform(
|
|||||||
command: str = config[CONF_COMMAND]
|
command: str = config[CONF_COMMAND]
|
||||||
payload_off: str = config[CONF_PAYLOAD_OFF]
|
payload_off: str = config[CONF_PAYLOAD_OFF]
|
||||||
payload_on: str = config[CONF_PAYLOAD_ON]
|
payload_on: str = config[CONF_PAYLOAD_ON]
|
||||||
device_class: str | None = config.get(CONF_DEVICE_CLASS)
|
device_class: BinarySensorDeviceClass | None = config.get(CONF_DEVICE_CLASS)
|
||||||
value_template: Template | None = config.get(CONF_VALUE_TEMPLATE)
|
value_template: Template | None = config.get(CONF_VALUE_TEMPLATE)
|
||||||
command_timeout: int = config[CONF_COMMAND_TIMEOUT]
|
command_timeout: int = config[CONF_COMMAND_TIMEOUT]
|
||||||
unique_id: str | None = config.get(CONF_UNIQUE_ID)
|
unique_id: str | None = config.get(CONF_UNIQUE_ID)
|
||||||
@ -95,7 +96,7 @@ class CommandBinarySensor(BinarySensorEntity):
|
|||||||
self,
|
self,
|
||||||
data: CommandSensorData,
|
data: CommandSensorData,
|
||||||
name: str,
|
name: str,
|
||||||
device_class: str | None,
|
device_class: BinarySensorDeviceClass | None,
|
||||||
payload_on: str,
|
payload_on: str,
|
||||||
payload_off: str,
|
payload_off: str,
|
||||||
value_template: Template | None,
|
value_template: Template | None,
|
||||||
|
@ -3,7 +3,7 @@ from __future__ import annotations
|
|||||||
|
|
||||||
from collections.abc import Mapping
|
from collections.abc import Mapping
|
||||||
import json
|
import json
|
||||||
from typing import Any
|
from typing import Any, cast
|
||||||
|
|
||||||
from homeassistant.components.binary_sensor import (
|
from homeassistant.components.binary_sensor import (
|
||||||
ENTITY_ID_FORMAT,
|
ENTITY_ID_FORMAT,
|
||||||
@ -69,7 +69,9 @@ class FibaroBinarySensor(FibaroDevice, BinarySensorEntity):
|
|||||||
elif fibaro_device.baseType in SENSOR_TYPES:
|
elif fibaro_device.baseType in SENSOR_TYPES:
|
||||||
self._fibaro_sensor_type = fibaro_device.baseType
|
self._fibaro_sensor_type = fibaro_device.baseType
|
||||||
if self._fibaro_sensor_type:
|
if self._fibaro_sensor_type:
|
||||||
self._attr_device_class = SENSOR_TYPES[self._fibaro_sensor_type][2]
|
self._attr_device_class = cast(
|
||||||
|
BinarySensorDeviceClass, SENSOR_TYPES[self._fibaro_sensor_type][2]
|
||||||
|
)
|
||||||
self._attr_icon = SENSOR_TYPES[self._fibaro_sensor_type][1]
|
self._attr_icon = SENSOR_TYPES[self._fibaro_sensor_type][1]
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
@ -81,7 +81,7 @@ class GeniusBattery(GeniusDevice, SensorEntity):
|
|||||||
return icon
|
return icon
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def device_class(self) -> str:
|
def device_class(self) -> SensorDeviceClass:
|
||||||
"""Return the device class of the sensor."""
|
"""Return the device class of the sensor."""
|
||||||
return SensorDeviceClass.BATTERY
|
return SensorDeviceClass.BATTERY
|
||||||
|
|
||||||
|
@ -7,6 +7,7 @@ from homeassistant.components.binary_sensor import (
|
|||||||
DEVICE_CLASSES_SCHEMA,
|
DEVICE_CLASSES_SCHEMA,
|
||||||
DOMAIN as BINARY_SENSOR_DOMAIN,
|
DOMAIN as BINARY_SENSOR_DOMAIN,
|
||||||
PLATFORM_SCHEMA,
|
PLATFORM_SCHEMA,
|
||||||
|
BinarySensorDeviceClass,
|
||||||
BinarySensorEntity,
|
BinarySensorEntity,
|
||||||
)
|
)
|
||||||
from homeassistant.config_entries import ConfigEntry
|
from homeassistant.config_entries import ConfigEntry
|
||||||
@ -94,7 +95,7 @@ class BinarySensorGroup(GroupEntity, BinarySensorEntity):
|
|||||||
self,
|
self,
|
||||||
unique_id: str | None,
|
unique_id: str | None,
|
||||||
name: str,
|
name: str,
|
||||||
device_class: str | None,
|
device_class: BinarySensorDeviceClass | None,
|
||||||
entity_ids: list[str],
|
entity_ids: list[str],
|
||||||
mode: str | None,
|
mode: str | None,
|
||||||
) -> None:
|
) -> None:
|
||||||
@ -149,6 +150,6 @@ class BinarySensorGroup(GroupEntity, BinarySensorEntity):
|
|||||||
self._attr_is_on = self.mode(state == STATE_ON for state in states)
|
self._attr_is_on = self.mode(state == STATE_ON for state in states)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def device_class(self) -> str | None:
|
def device_class(self) -> BinarySensorDeviceClass | None:
|
||||||
"""Return the sensor class of the binary sensor."""
|
"""Return the sensor class of the binary sensor."""
|
||||||
return self._device_class
|
return self._device_class
|
||||||
|
@ -195,7 +195,7 @@ class HomematicipBaseActionSensor(HomematicipGenericEntity, BinarySensorEntity):
|
|||||||
"""Representation of the HomematicIP base action sensor."""
|
"""Representation of the HomematicIP base action sensor."""
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def device_class(self) -> str:
|
def device_class(self) -> BinarySensorDeviceClass:
|
||||||
"""Return the class of this sensor."""
|
"""Return the class of this sensor."""
|
||||||
return BinarySensorDeviceClass.MOVING
|
return BinarySensorDeviceClass.MOVING
|
||||||
|
|
||||||
@ -240,7 +240,7 @@ class HomematicipMultiContactInterface(HomematicipGenericEntity, BinarySensorEnt
|
|||||||
)
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def device_class(self) -> str:
|
def device_class(self) -> BinarySensorDeviceClass:
|
||||||
"""Return the class of this sensor."""
|
"""Return the class of this sensor."""
|
||||||
return BinarySensorDeviceClass.OPENING
|
return BinarySensorDeviceClass.OPENING
|
||||||
|
|
||||||
@ -274,7 +274,7 @@ class HomematicipShutterContact(HomematicipMultiContactInterface, BinarySensorEn
|
|||||||
self.has_additional_state = has_additional_state
|
self.has_additional_state = has_additional_state
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def device_class(self) -> str:
|
def device_class(self) -> BinarySensorDeviceClass:
|
||||||
"""Return the class of this sensor."""
|
"""Return the class of this sensor."""
|
||||||
return BinarySensorDeviceClass.DOOR
|
return BinarySensorDeviceClass.DOOR
|
||||||
|
|
||||||
@ -295,7 +295,7 @@ class HomematicipMotionDetector(HomematicipGenericEntity, BinarySensorEntity):
|
|||||||
"""Representation of the HomematicIP motion detector."""
|
"""Representation of the HomematicIP motion detector."""
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def device_class(self) -> str:
|
def device_class(self) -> BinarySensorDeviceClass:
|
||||||
"""Return the class of this sensor."""
|
"""Return the class of this sensor."""
|
||||||
return BinarySensorDeviceClass.MOTION
|
return BinarySensorDeviceClass.MOTION
|
||||||
|
|
||||||
@ -309,7 +309,7 @@ class HomematicipPresenceDetector(HomematicipGenericEntity, BinarySensorEntity):
|
|||||||
"""Representation of the HomematicIP presence detector."""
|
"""Representation of the HomematicIP presence detector."""
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def device_class(self) -> str:
|
def device_class(self) -> BinarySensorDeviceClass:
|
||||||
"""Return the class of this sensor."""
|
"""Return the class of this sensor."""
|
||||||
return BinarySensorDeviceClass.PRESENCE
|
return BinarySensorDeviceClass.PRESENCE
|
||||||
|
|
||||||
@ -323,7 +323,7 @@ class HomematicipSmokeDetector(HomematicipGenericEntity, BinarySensorEntity):
|
|||||||
"""Representation of the HomematicIP smoke detector."""
|
"""Representation of the HomematicIP smoke detector."""
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def device_class(self) -> str:
|
def device_class(self) -> BinarySensorDeviceClass:
|
||||||
"""Return the class of this sensor."""
|
"""Return the class of this sensor."""
|
||||||
return BinarySensorDeviceClass.SMOKE
|
return BinarySensorDeviceClass.SMOKE
|
||||||
|
|
||||||
@ -342,7 +342,7 @@ class HomematicipWaterDetector(HomematicipGenericEntity, BinarySensorEntity):
|
|||||||
"""Representation of the HomematicIP water detector."""
|
"""Representation of the HomematicIP water detector."""
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def device_class(self) -> str:
|
def device_class(self) -> BinarySensorDeviceClass:
|
||||||
"""Return the class of this sensor."""
|
"""Return the class of this sensor."""
|
||||||
return BinarySensorDeviceClass.MOISTURE
|
return BinarySensorDeviceClass.MOISTURE
|
||||||
|
|
||||||
@ -378,7 +378,7 @@ class HomematicipRainSensor(HomematicipGenericEntity, BinarySensorEntity):
|
|||||||
super().__init__(hap, device, "Raining")
|
super().__init__(hap, device, "Raining")
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def device_class(self) -> str:
|
def device_class(self) -> BinarySensorDeviceClass:
|
||||||
"""Return the class of this sensor."""
|
"""Return the class of this sensor."""
|
||||||
return BinarySensorDeviceClass.MOISTURE
|
return BinarySensorDeviceClass.MOISTURE
|
||||||
|
|
||||||
@ -396,7 +396,7 @@ class HomematicipSunshineSensor(HomematicipGenericEntity, BinarySensorEntity):
|
|||||||
super().__init__(hap, device, post="Sunshine")
|
super().__init__(hap, device, post="Sunshine")
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def device_class(self) -> str:
|
def device_class(self) -> BinarySensorDeviceClass:
|
||||||
"""Return the class of this sensor."""
|
"""Return the class of this sensor."""
|
||||||
return BinarySensorDeviceClass.LIGHT
|
return BinarySensorDeviceClass.LIGHT
|
||||||
|
|
||||||
@ -425,7 +425,7 @@ class HomematicipBatterySensor(HomematicipGenericEntity, BinarySensorEntity):
|
|||||||
super().__init__(hap, device, post="Battery")
|
super().__init__(hap, device, post="Battery")
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def device_class(self) -> str:
|
def device_class(self) -> BinarySensorDeviceClass:
|
||||||
"""Return the class of this sensor."""
|
"""Return the class of this sensor."""
|
||||||
return BinarySensorDeviceClass.BATTERY
|
return BinarySensorDeviceClass.BATTERY
|
||||||
|
|
||||||
@ -445,7 +445,7 @@ class HomematicipPluggableMainsFailureSurveillanceSensor(
|
|||||||
super().__init__(hap, device)
|
super().__init__(hap, device)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def device_class(self) -> str:
|
def device_class(self) -> BinarySensorDeviceClass:
|
||||||
"""Return the class of this sensor."""
|
"""Return the class of this sensor."""
|
||||||
return BinarySensorDeviceClass.POWER
|
return BinarySensorDeviceClass.POWER
|
||||||
|
|
||||||
@ -464,7 +464,7 @@ class HomematicipSecurityZoneSensorGroup(HomematicipGenericEntity, BinarySensorE
|
|||||||
super().__init__(hap, device, post=post)
|
super().__init__(hap, device, post=post)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def device_class(self) -> str:
|
def device_class(self) -> BinarySensorDeviceClass:
|
||||||
"""Return the class of this sensor."""
|
"""Return the class of this sensor."""
|
||||||
return BinarySensorDeviceClass.SAFETY
|
return BinarySensorDeviceClass.SAFETY
|
||||||
|
|
||||||
|
@ -205,7 +205,7 @@ class HomematicipHumiditySensor(HomematicipGenericEntity, SensorEntity):
|
|||||||
super().__init__(hap, device, post="Humidity")
|
super().__init__(hap, device, post="Humidity")
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def device_class(self) -> str:
|
def device_class(self) -> SensorDeviceClass:
|
||||||
"""Return the device class of the sensor."""
|
"""Return the device class of the sensor."""
|
||||||
return SensorDeviceClass.HUMIDITY
|
return SensorDeviceClass.HUMIDITY
|
||||||
|
|
||||||
@ -230,7 +230,7 @@ class HomematicipTemperatureSensor(HomematicipGenericEntity, SensorEntity):
|
|||||||
super().__init__(hap, device, post="Temperature")
|
super().__init__(hap, device, post="Temperature")
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def device_class(self) -> str:
|
def device_class(self) -> SensorDeviceClass:
|
||||||
"""Return the device class of the sensor."""
|
"""Return the device class of the sensor."""
|
||||||
return SensorDeviceClass.TEMPERATURE
|
return SensorDeviceClass.TEMPERATURE
|
||||||
|
|
||||||
@ -269,7 +269,7 @@ class HomematicipIlluminanceSensor(HomematicipGenericEntity, SensorEntity):
|
|||||||
super().__init__(hap, device, post="Illuminance")
|
super().__init__(hap, device, post="Illuminance")
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def device_class(self) -> str:
|
def device_class(self) -> SensorDeviceClass:
|
||||||
"""Return the device class of the sensor."""
|
"""Return the device class of the sensor."""
|
||||||
return SensorDeviceClass.ILLUMINANCE
|
return SensorDeviceClass.ILLUMINANCE
|
||||||
|
|
||||||
@ -308,7 +308,7 @@ class HomematicipPowerSensor(HomematicipGenericEntity, SensorEntity):
|
|||||||
super().__init__(hap, device, post="Power")
|
super().__init__(hap, device, post="Power")
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def device_class(self) -> str:
|
def device_class(self) -> SensorDeviceClass:
|
||||||
"""Return the device class of the sensor."""
|
"""Return the device class of the sensor."""
|
||||||
return SensorDeviceClass.POWER
|
return SensorDeviceClass.POWER
|
||||||
|
|
||||||
@ -333,7 +333,7 @@ class HomematicipEnergySensor(HomematicipGenericEntity, SensorEntity):
|
|||||||
super().__init__(hap, device, post="Energy")
|
super().__init__(hap, device, post="Energy")
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def device_class(self) -> str:
|
def device_class(self) -> SensorDeviceClass:
|
||||||
"""Return the device class of the sensor."""
|
"""Return the device class of the sensor."""
|
||||||
return SensorDeviceClass.ENERGY
|
return SensorDeviceClass.ENERGY
|
||||||
|
|
||||||
@ -411,7 +411,7 @@ class HomematicpTemperatureExternalSensorCh1(HomematicipGenericEntity, SensorEnt
|
|||||||
super().__init__(hap, device, post="Channel 1 Temperature")
|
super().__init__(hap, device, post="Channel 1 Temperature")
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def device_class(self) -> str:
|
def device_class(self) -> SensorDeviceClass:
|
||||||
"""Return the device class of the sensor."""
|
"""Return the device class of the sensor."""
|
||||||
return SensorDeviceClass.TEMPERATURE
|
return SensorDeviceClass.TEMPERATURE
|
||||||
|
|
||||||
@ -436,7 +436,7 @@ class HomematicpTemperatureExternalSensorCh2(HomematicipGenericEntity, SensorEnt
|
|||||||
super().__init__(hap, device, post="Channel 2 Temperature")
|
super().__init__(hap, device, post="Channel 2 Temperature")
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def device_class(self) -> str:
|
def device_class(self) -> SensorDeviceClass:
|
||||||
"""Return the device class of the sensor."""
|
"""Return the device class of the sensor."""
|
||||||
return SensorDeviceClass.TEMPERATURE
|
return SensorDeviceClass.TEMPERATURE
|
||||||
|
|
||||||
@ -461,7 +461,7 @@ class HomematicpTemperatureExternalSensorDelta(HomematicipGenericEntity, SensorE
|
|||||||
super().__init__(hap, device, post="Delta Temperature")
|
super().__init__(hap, device, post="Delta Temperature")
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def device_class(self) -> str:
|
def device_class(self) -> SensorDeviceClass:
|
||||||
"""Return the device class of the sensor."""
|
"""Return the device class of the sensor."""
|
||||||
return SensorDeviceClass.TEMPERATURE
|
return SensorDeviceClass.TEMPERATURE
|
||||||
|
|
||||||
|
@ -3,7 +3,11 @@ from __future__ import annotations
|
|||||||
|
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from homeassistant.components.sensor import SensorEntity, SensorStateClass
|
from homeassistant.components.sensor import (
|
||||||
|
SensorDeviceClass,
|
||||||
|
SensorEntity,
|
||||||
|
SensorStateClass,
|
||||||
|
)
|
||||||
from homeassistant.config_entries import ConfigEntry
|
from homeassistant.config_entries import ConfigEntry
|
||||||
from homeassistant.const import CONF_ID, POWER_WATT
|
from homeassistant.const import CONF_ID, POWER_WATT
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
@ -42,7 +46,7 @@ class HuisbaasjeSensor(CoordinatorEntity, SensorEntity):
|
|||||||
user_id: str,
|
user_id: str,
|
||||||
name: str,
|
name: str,
|
||||||
source_type: str,
|
source_type: str,
|
||||||
device_class: str | None = None,
|
device_class: SensorDeviceClass | None = None,
|
||||||
sensor_type: str = SENSOR_TYPE_RATE,
|
sensor_type: str = SENSOR_TYPE_RATE,
|
||||||
unit_of_measurement: str = POWER_WATT,
|
unit_of_measurement: str = POWER_WATT,
|
||||||
icon: str = "mdi:lightning-bolt",
|
icon: str = "mdi:lightning-bolt",
|
||||||
@ -72,7 +76,7 @@ class HuisbaasjeSensor(CoordinatorEntity, SensorEntity):
|
|||||||
return self._name
|
return self._name
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def device_class(self) -> str | None:
|
def device_class(self) -> SensorDeviceClass | None:
|
||||||
"""Return the device class of the sensor."""
|
"""Return the device class of the sensor."""
|
||||||
return self._device_class
|
return self._device_class
|
||||||
|
|
||||||
|
@ -54,7 +54,7 @@ class HassAqualinkSensor(AqualinkEntity, SensorEntity):
|
|||||||
return float(self.dev.state)
|
return float(self.dev.state)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def device_class(self) -> str | None:
|
def device_class(self) -> SensorDeviceClass | None:
|
||||||
"""Return the class of the sensor."""
|
"""Return the class of the sensor."""
|
||||||
if self.dev.name.endswith("_temp"):
|
if self.dev.name.endswith("_temp"):
|
||||||
return SensorDeviceClass.TEMPERATURE
|
return SensorDeviceClass.TEMPERATURE
|
||||||
|
@ -79,7 +79,7 @@ class NeatoSensor(SensorEntity):
|
|||||||
return self._robot_serial
|
return self._robot_serial
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def device_class(self) -> str:
|
def device_class(self) -> SensorDeviceClass:
|
||||||
"""Return the device class."""
|
"""Return the device class."""
|
||||||
return SensorDeviceClass.BATTERY
|
return SensorDeviceClass.BATTERY
|
||||||
|
|
||||||
|
@ -62,12 +62,12 @@ class NINAMessage(CoordinatorEntity[NINADataUpdateCoordinator], BinarySensorEnti
|
|||||||
"""Initialize."""
|
"""Initialize."""
|
||||||
super().__init__(coordinator)
|
super().__init__(coordinator)
|
||||||
|
|
||||||
self._region: str = region
|
self._region = region
|
||||||
self._warning_index: int = slot_id - 1
|
self._warning_index = slot_id - 1
|
||||||
|
|
||||||
self._attr_name: str = f"Warning: {region_name} {slot_id}"
|
self._attr_name = f"Warning: {region_name} {slot_id}"
|
||||||
self._attr_unique_id: str = f"{region}-{slot_id}"
|
self._attr_unique_id = f"{region}-{slot_id}"
|
||||||
self._attr_device_class: str = BinarySensorDeviceClass.SAFETY
|
self._attr_device_class = BinarySensorDeviceClass.SAFETY
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def is_on(self) -> bool:
|
def is_on(self) -> bool:
|
||||||
|
@ -78,7 +78,7 @@ class TriggeredBinarySensor(SimpliSafeEntity, BinarySensorEntity):
|
|||||||
simplisafe: SimpliSafe,
|
simplisafe: SimpliSafe,
|
||||||
system: SystemV3,
|
system: SystemV3,
|
||||||
sensor: SensorV3,
|
sensor: SensorV3,
|
||||||
device_class: str,
|
device_class: BinarySensorDeviceClass,
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Initialize."""
|
"""Initialize."""
|
||||||
super().__init__(simplisafe, system, device=sensor)
|
super().__init__(simplisafe, system, device=sensor)
|
||||||
|
@ -30,8 +30,8 @@ class AttributeDescription:
|
|||||||
name: str
|
name: str
|
||||||
icon: str | None = None
|
icon: str | None = None
|
||||||
unit: str | None = None
|
unit: str | None = None
|
||||||
device_class: str | None = None
|
device_class: SensorDeviceClass | None = None
|
||||||
state_class: str | None = None
|
state_class: SensorStateClass | None = None
|
||||||
default_enabled: bool = True
|
default_enabled: bool = True
|
||||||
|
|
||||||
|
|
||||||
|
@ -65,7 +65,7 @@ class VeraSensor(VeraDevice[veraApi.VeraSensor], SensorEntity):
|
|||||||
return self.current_value
|
return self.current_value
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def device_class(self) -> str | None:
|
def device_class(self) -> SensorDeviceClass | None:
|
||||||
"""Return the class of this entity."""
|
"""Return the class of this entity."""
|
||||||
if self.vera_device.category == veraApi.CATEGORY_TEMPERATURE_SENSOR:
|
if self.vera_device.category == veraApi.CATEGORY_TEMPERATURE_SENSOR:
|
||||||
return SensorDeviceClass.TEMPERATURE
|
return SensorDeviceClass.TEMPERATURE
|
||||||
|
Loading…
x
Reference in New Issue
Block a user