Remove extra check - ignore arg type

This commit is contained in:
jbouwh
2025-08-22 16:55:42 +00:00
parent 32800a0453
commit 76cbe7af73
2 changed files with 6 additions and 7 deletions

View File

@@ -373,10 +373,10 @@ class NumberEntity(Entity, cached_properties=CACHED_PROPERTIES_WITH_ATTR_):
@property
def __native_unit_of_measurement_compat(self) -> str | None:
"""Process ambiguous units."""
if (native_unit_of_measurement := self.native_unit_of_measurement) is None:
return None
native_unit_of_measurement = self.native_unit_of_measurement
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

View File

@@ -474,11 +474,10 @@ class SensorEntity(Entity, cached_properties=CACHED_PROPERTIES_WITH_ATTR_):
@property
def __native_unit_of_measurement_compat(self) -> str | None:
"""Process ambiguous units."""
if (native_unit_of_measurement := self.native_unit_of_measurement) is None:
return None
native_unit_of_measurement = self.native_unit_of_measurement
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]
)
@cached_property