mirror of
https://github.com/home-assistant/core.git
synced 2025-07-13 16:27:08 +00:00
Improve type hints in demo and mqtt number entity (#76464)
This commit is contained in:
parent
f7c23fe193
commit
c8f11d65d2
@ -131,7 +131,7 @@ class DemoNumber(NumberEntity):
|
|||||||
name=self.name,
|
name=self.name,
|
||||||
)
|
)
|
||||||
|
|
||||||
async def async_set_native_value(self, value):
|
async def async_set_native_value(self, value: float) -> None:
|
||||||
"""Update the current value."""
|
"""Update the current value."""
|
||||||
self._attr_native_value = value
|
self._attr_native_value = value
|
||||||
self.async_write_ha_state()
|
self.async_write_ha_state()
|
||||||
|
@ -272,7 +272,7 @@ class MqttNumber(MqttEntity, RestoreNumber):
|
|||||||
return self._config.get(CONF_UNIT_OF_MEASUREMENT)
|
return self._config.get(CONF_UNIT_OF_MEASUREMENT)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def native_value(self):
|
def native_value(self) -> float | None:
|
||||||
"""Return the current value."""
|
"""Return the current value."""
|
||||||
return self._current_number
|
return self._current_number
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user