Improve type hints in yamaha_musiccast number (#76467)

This commit is contained in:
epenet 2022-08-11 00:16:38 +02:00 committed by GitHub
parent 46d3f2e14c
commit 0edf82fcb4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,4 +1,5 @@
"""Number entities for musiccast."""
from __future__ import annotations
from aiomusiccast.capabilities import NumberSetter
@ -50,10 +51,10 @@ class NumberCapability(MusicCastCapabilityEntity, NumberEntity):
self._attr_native_step = capability.value_range.step
@property
def native_value(self):
def native_value(self) -> float | None:
"""Return the current value."""
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."""
await self.capability.set(value)