1
mirror of https://github.com/home-assistant/core synced 2024-08-02 23:40:32 +02:00

Improve type hints in demo and mqtt number entity (#76464)

This commit is contained in:
epenet 2022-08-11 00:10:28 +02:00 committed by GitHub
parent f7c23fe193
commit c8f11d65d2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -131,7 +131,7 @@ class DemoNumber(NumberEntity):
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."""
self._attr_native_value = value
self.async_write_ha_state()

View File

@ -272,7 +272,7 @@ class MqttNumber(MqttEntity, RestoreNumber):
return self._config.get(CONF_UNIT_OF_MEASUREMENT)
@property
def native_value(self):
def native_value(self) -> float | None:
"""Return the current value."""
return self._current_number