Skip to content

Commit 28396a0

Browse files
authored
Version 1.0.5 (#122)
2 parents 9d66765 + c7a415d commit 28396a0

4 files changed

Lines changed: 13 additions & 5 deletions

File tree

pyheos/command/player.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,8 @@ async def player_set_play_state(self, player_id: int, state: PlayState) -> None:
175175
176176
References:
177177
4.2.4 Set Play State"""
178+
if state is PlayState.UNKNOWN:
179+
raise ValueError("'state' can not be set to 'unknown'")
178180
await self._connection.command(
179181
HeosCommand(
180182
c.COMMAND_SET_PLAY_STATE,

pyheos/types.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ class PlayState(StrEnum):
7878
PLAY = "play"
7979
PAUSE = "pause"
8080
STOP = "stop"
81+
UNKNOWN = "unknown"
8182

8283

8384
class SignalType(StrEnum):

pyproject.toml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,19 @@
11
[build-system]
2-
requires = ["setuptools", "wheel"]
2+
requires = ["setuptools>=77.0", "wheel"]
33
build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "pyheos"
7-
version = "1.0.4"
7+
version = "1.0.5"
88
description = "An async python library for controlling HEOS devices through the HEOS CLI Protocol"
99
readme = "README.md"
1010
requires-python = ">=3.11"
11-
license = { text = "ASL 2.0" }
11+
license = "Apache-2.0"
1212
authors = [{ name = "Andrew Sayre", email = "andrew@sayre.net" }]
1313
keywords = ["heos", "dennon", "maranz"]
1414
classifiers = [
1515
"Development Status :: 5 - Production/Stable",
1616
"Intended Audience :: Developers",
17-
"License :: OSI Approved :: Apache Software License",
1817
"Operating System :: OS Independent",
1918
"Topic :: Software Development :: Libraries",
2019
"Topic :: Home Automation",
@@ -367,4 +366,4 @@ skip_empty = true
367366
sort = "Name"
368367

369368
[tool.codespell]
370-
skip = "./tests/fixtures/*,./tests/snapshots/*"
369+
skip = "./tests/fixtures/*,./tests/snapshots/*"

tests/test_player.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,12 @@ async def test_set_state(player: HeosPlayer, state: PlayState) -> None:
106106
await player.set_state(state)
107107

108108

109+
async def test_set_state_unknown_raises(player: HeosPlayer) -> None:
110+
"""Test setting play state to unknown raises."""
111+
with pytest.raises(ValueError):
112+
await player.set_state(PlayState.UNKNOWN)
113+
114+
109115
@calls_command(
110116
"player.set_play_state",
111117
{c.ATTR_PLAYER_ID: 1, c.ATTR_STATE: PlayState.PLAY},

0 commit comments

Comments
 (0)