Skip to content

Commit

Permalink
Added check for 0 display width/height
Browse files Browse the repository at this point in the history
Disable display if width/height are 0. Should fix home-assistant-libs#331
  • Loading branch information
JamiePhonic authored and JamiePhonic committed Aug 24, 2024
1 parent d98e150 commit f5042cb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion aioslimproto/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -976,7 +976,9 @@ def _process_setd(self, data: bytes) -> None:
resolution = f"{display_width} x {display_height}"
self.callback(self, EventType.PLAYER_DISPLAY_RESOLUTION, resolution)

if self.display_control.image.width != display_width:
if display_width == 0 or display_height == 0:
self.display_control.disabled(True) # noqa: FBT003
elif self.display_control.image.width != display_width:
# If the display resolution reported by the player doesn't match
# the display resolution we're currently using
self.display_control = None
Expand Down

0 comments on commit f5042cb

Please sign in to comment.