mirror of
https://github.com/home-assistant/core.git
synced 2025-08-31 02:11:32 +02:00
Remove extra check - ignore arg type
This commit is contained in:
@@ -373,10 +373,10 @@ class NumberEntity(Entity, cached_properties=CACHED_PROPERTIES_WITH_ATTR_):
|
|||||||
@property
|
@property
|
||||||
def __native_unit_of_measurement_compat(self) -> str | None:
|
def __native_unit_of_measurement_compat(self) -> str | None:
|
||||||
"""Process ambiguous units."""
|
"""Process ambiguous units."""
|
||||||
if (native_unit_of_measurement := self.native_unit_of_measurement) is None:
|
native_unit_of_measurement = self.native_unit_of_measurement
|
||||||
return None
|
|
||||||
return AMBIGUOUS_UNITS.get(
|
return AMBIGUOUS_UNITS.get(
|
||||||
native_unit_of_measurement, native_unit_of_measurement
|
native_unit_of_measurement, # type: ignore[arg-type]
|
||||||
|
native_unit_of_measurement, # type: ignore[arg-type]
|
||||||
)
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
@@ -474,11 +474,10 @@ class SensorEntity(Entity, cached_properties=CACHED_PROPERTIES_WITH_ATTR_):
|
|||||||
@property
|
@property
|
||||||
def __native_unit_of_measurement_compat(self) -> str | None:
|
def __native_unit_of_measurement_compat(self) -> str | None:
|
||||||
"""Process ambiguous units."""
|
"""Process ambiguous units."""
|
||||||
if (native_unit_of_measurement := self.native_unit_of_measurement) is None:
|
native_unit_of_measurement = self.native_unit_of_measurement
|
||||||
return None
|
|
||||||
return AMBIGUOUS_UNITS.get(
|
return AMBIGUOUS_UNITS.get(
|
||||||
native_unit_of_measurement,
|
native_unit_of_measurement, # type: ignore[arg-type]
|
||||||
native_unit_of_measurement,
|
native_unit_of_measurement, # type: ignore[arg-type]
|
||||||
)
|
)
|
||||||
|
|
||||||
@cached_property
|
@cached_property
|
||||||
|
Reference in New Issue
Block a user