Fix Epson wrong volume value (#75264)

This commit is contained in:
Pawel 2022-07-26 08:50:21 +02:00 committed by GitHub
parent ce4e53938c
commit b57e0d13b4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 9 additions and 4 deletions

View File

@ -3,7 +3,7 @@
"name": "Epson", "name": "Epson",
"config_flow": true, "config_flow": true,
"documentation": "https://www.home-assistant.io/integrations/epson", "documentation": "https://www.home-assistant.io/integrations/epson",
"requirements": ["epson-projector==0.4.2"], "requirements": ["epson-projector==0.4.6"],
"codeowners": ["@pszafer"], "codeowners": ["@pszafer"],
"iot_class": "local_polling", "iot_class": "local_polling",
"loggers": ["epson_projector"] "loggers": ["epson_projector"]

View File

@ -133,7 +133,10 @@ class EpsonProjectorMediaPlayer(MediaPlayerEntity):
self._source = SOURCE_LIST.get(source, self._source) self._source = SOURCE_LIST.get(source, self._source)
volume = await self._projector.get_property(VOLUME) volume = await self._projector.get_property(VOLUME)
if volume: if volume:
self._volume = volume try:
self._volume = float(volume)
except ValueError:
self._volume = None
elif power_state == BUSY: elif power_state == BUSY:
self._state = STATE_ON self._state = STATE_ON
else: else:
@ -176,11 +179,13 @@ class EpsonProjectorMediaPlayer(MediaPlayerEntity):
"""Turn on epson.""" """Turn on epson."""
if self._state == STATE_OFF: if self._state == STATE_OFF:
await self._projector.send_command(TURN_ON) await self._projector.send_command(TURN_ON)
self._state = STATE_ON
async def async_turn_off(self): async def async_turn_off(self):
"""Turn off epson.""" """Turn off epson."""
if self._state == STATE_ON: if self._state == STATE_ON:
await self._projector.send_command(TURN_OFF) await self._projector.send_command(TURN_OFF)
self._state = STATE_OFF
@property @property
def source_list(self): def source_list(self):

View File

@ -619,7 +619,7 @@ envoy_reader==0.20.1
ephem==4.1.2 ephem==4.1.2
# homeassistant.components.epson # homeassistant.components.epson
epson-projector==0.4.2 epson-projector==0.4.6
# homeassistant.components.epsonworkforce # homeassistant.components.epsonworkforce
epsonprinter==0.0.9 epsonprinter==0.0.9

View File

@ -465,7 +465,7 @@ envoy_reader==0.20.1
ephem==4.1.2 ephem==4.1.2
# homeassistant.components.epson # homeassistant.components.epson
epson-projector==0.4.2 epson-projector==0.4.6
# homeassistant.components.faa_delays # homeassistant.components.faa_delays
faadelays==0.0.7 faadelays==0.0.7