mirror of
https://github.com/home-assistant/core.git
synced 2025-08-04 05:05:09 +02:00
Improve type hints in yamaha_musiccast number (#76467)
This commit is contained in:
@@ -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)
|
||||||
|
Reference in New Issue
Block a user