Skip to content

Commit

Permalink
Lights can't have a scene set on them
Browse files Browse the repository at this point in the history
  • Loading branch information
trickeydan committed Jul 10, 2021
1 parent f67abf5 commit 10ea5a6
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 4 deletions.
2 changes: 1 addition & 1 deletion hue2mqtt/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@
"__version__",
]

__version__ = "0.2.0"
__version__ = "0.2.1"
10 changes: 8 additions & 2 deletions hue2mqtt/hue2mqtt.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,13 @@

from hue2mqtt import __version__
from hue2mqtt.messages import BridgeInfo, Hue2MQTTStatus
from hue2mqtt.schema import GroupInfo, LightInfo, LightSetState, SensorInfo
from hue2mqtt.schema import (
GroupInfo,
GroupSetState,
LightInfo,
LightSetState,
SensorInfo,
)

from .config import Hue2MQTTConfig
from .mqtt.wrapper import MQTTWrapper
Expand Down Expand Up @@ -177,7 +183,7 @@ async def handle_set_group(self, match: Match[str], payload: str) -> None:

try:
group = self._bridge.groups[groupid]
state = LightSetState(**json.loads(payload))
state = GroupSetState(**json.loads(payload))
LOGGER.info(f"Updating group {group.name}")
await group.set_action(**state.dict())
except IndexError:
Expand Down
5 changes: 5 additions & 0 deletions hue2mqtt/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ class LightSetState(LightBaseState):
hue_inc: Optional[int]
ct_inc: Optional[int]
xy_inc: Optional[int]


class GroupSetState(LightSetState):
"""The settable states of a group."""

scene: Optional[str]


Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "hue2mqtt"
version = "0.2.0"
version = "0.2.1"
description = "Python Hue to MQTT Bridge"
authors = ["Dan Trickey <[email protected]>"]
license = "MIT"
Expand Down

0 comments on commit 10ea5a6

Please sign in to comment.