Use enums in zwave (#62131)
Co-authored-by: Franck Nijhof <git@frenck.dev>
This commit is contained in:
parent
abb36ff45f
commit
867cbeedb9
3 changed files with 8 additions and 7 deletions
|
@ -1,6 +1,6 @@
|
|||
"""Support for Z-Wave sensors."""
|
||||
from homeassistant.components.sensor import DEVICE_CLASS_BATTERY, DOMAIN, SensorEntity
|
||||
from homeassistant.const import DEVICE_CLASS_TEMPERATURE, TEMP_CELSIUS, TEMP_FAHRENHEIT
|
||||
from homeassistant.components.sensor import DOMAIN, SensorDeviceClass, SensorEntity
|
||||
from homeassistant.const import TEMP_CELSIUS, TEMP_FAHRENHEIT
|
||||
from homeassistant.core import callback
|
||||
from homeassistant.helpers.dispatcher import async_dispatcher_connect
|
||||
|
||||
|
@ -83,7 +83,7 @@ class ZWaveMultilevelSensor(ZWaveSensor):
|
|||
def device_class(self):
|
||||
"""Return the class of this device."""
|
||||
if self._units in ["C", "F"]:
|
||||
return DEVICE_CLASS_TEMPERATURE
|
||||
return SensorDeviceClass.TEMPERATURE
|
||||
return None
|
||||
|
||||
@property
|
||||
|
@ -115,4 +115,4 @@ class ZWaveBatterySensor(ZWaveSensor):
|
|||
@property
|
||||
def device_class(self):
|
||||
"""Return the class of this device."""
|
||||
return DEVICE_CLASS_BATTERY
|
||||
return SensorDeviceClass.BATTERY
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue