Split esphome state property decorators (#124332)

This commit is contained in:
J. Nick Koston 2024-08-25 06:48:17 -10:00 committed by GitHub
parent ebc49d938a
commit 41b129e990
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 49 additions and 36 deletions

View file

@ -29,6 +29,7 @@ from homeassistant.core import callback
from .entity import (
EsphomeEntity,
convert_api_error_ha_error,
esphome_float_state_property,
esphome_state_property,
platform_async_setup_entry,
)
@ -79,7 +80,7 @@ class EsphomeMediaPlayer(
return self._state.muted
@property
@esphome_state_property
@esphome_float_state_property
def volume_level(self) -> float | None:
"""Volume level of the media player (0..1)."""
return self._state.volume