mirror of
https://github.com/home-assistant/core.git
synced 2025-07-16 17:57:11 +00:00
Fix temperature unit in sensor for Sensibo (#80843)
This commit is contained in:
parent
b04165b495
commit
d85866d49c
@ -23,7 +23,6 @@ from homeassistant.const import (
|
||||
PERCENTAGE,
|
||||
SIGNAL_STRENGTH_DECIBELS_MILLIWATT,
|
||||
TEMP_CELSIUS,
|
||||
TEMP_FAHRENHEIT,
|
||||
)
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.helpers.entity import EntityCategory
|
||||
@ -263,9 +262,7 @@ class SensiboMotionSensor(SensiboMotionBaseEntity, SensorEntity):
|
||||
def native_unit_of_measurement(self) -> str | None:
|
||||
"""Add native unit of measurement."""
|
||||
if self.entity_description.device_class == SensorDeviceClass.TEMPERATURE:
|
||||
return (
|
||||
TEMP_CELSIUS if self.device_data.temp_unit == "C" else TEMP_FAHRENHEIT
|
||||
)
|
||||
return TEMP_CELSIUS
|
||||
return self.entity_description.native_unit_of_measurement
|
||||
|
||||
@property
|
||||
@ -299,9 +296,7 @@ class SensiboDeviceSensor(SensiboDeviceBaseEntity, SensorEntity):
|
||||
def native_unit_of_measurement(self) -> str | None:
|
||||
"""Add native unit of measurement."""
|
||||
if self.entity_description.device_class == SensorDeviceClass.TEMPERATURE:
|
||||
return (
|
||||
TEMP_CELSIUS if self.device_data.temp_unit == "C" else TEMP_FAHRENHEIT
|
||||
)
|
||||
return TEMP_CELSIUS
|
||||
return self.entity_description.native_unit_of_measurement
|
||||
|
||||
@property
|
||||
|
Loading…
x
Reference in New Issue
Block a user