Hint for str type instead of explicitly casting to str (#52712)
This commit is contained in:
parent
62c7e5408b
commit
abca7deadb
1 changed files with 3 additions and 1 deletions
|
@ -1,6 +1,8 @@
|
||||||
"""Support for LCN sensors."""
|
"""Support for LCN sensors."""
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
|
from typing import cast
|
||||||
|
|
||||||
import pypck
|
import pypck
|
||||||
|
|
||||||
from homeassistant.components.sensor import DOMAIN as DOMAIN_SENSOR, SensorEntity
|
from homeassistant.components.sensor import DOMAIN as DOMAIN_SENSOR, SensorEntity
|
||||||
|
@ -97,7 +99,7 @@ class LcnVariableSensor(LcnEntity, SensorEntity):
|
||||||
@property
|
@property
|
||||||
def unit_of_measurement(self) -> str:
|
def unit_of_measurement(self) -> str:
|
||||||
"""Return the unit of measurement of this entity, if any."""
|
"""Return the unit of measurement of this entity, if any."""
|
||||||
return str(self.unit.value)
|
return cast(str, self.unit.value)
|
||||||
|
|
||||||
def input_received(self, input_obj: InputType) -> None:
|
def input_received(self, input_obj: InputType) -> None:
|
||||||
"""Set sensor value when LCN input object (command) is received."""
|
"""Set sensor value when LCN input object (command) is received."""
|
||||||
|
|
Loading…
Add table
Reference in a new issue