mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 05:07:41 +00:00
Improve type hints in yamaha_musiccast number (#76467)
This commit is contained in:
parent
46d3f2e14c
commit
0edf82fcb4
@ -1,4 +1,5 @@
|
|||||||
"""Number entities for musiccast."""
|
"""Number entities for musiccast."""
|
||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
from aiomusiccast.capabilities import NumberSetter
|
from aiomusiccast.capabilities import NumberSetter
|
||||||
|
|
||||||
@ -50,10 +51,10 @@ class NumberCapability(MusicCastCapabilityEntity, NumberEntity):
|
|||||||
self._attr_native_step = capability.value_range.step
|
self._attr_native_step = capability.value_range.step
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def native_value(self):
|
def native_value(self) -> float | None:
|
||||||
"""Return the current value."""
|
"""Return the current value."""
|
||||||
return self.capability.current
|
return self.capability.current
|
||||||
|
|
||||||
async def async_set_native_value(self, value: float):
|
async def async_set_native_value(self, value: float) -> None:
|
||||||
"""Set a new value."""
|
"""Set a new value."""
|
||||||
await self.capability.set(value)
|
await self.capability.set(value)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user