Skip to content

Commit

Permalink
Add EVENT_APPLIANCE_UPDATE_RECEIVED event
Browse files Browse the repository at this point in the history
  • Loading branch information
ajmarks committed Sep 16, 2020
1 parent cf0b9f8 commit 240703e
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ little about the appliance. The `GeAppliance` object is passed to the callback.
state is received. A tuple `(appliance, state_changes)` is passed to the callback, where `appliance` is the
`GeAppliance` object with the updated state and `state_changes` is a dictionary `{erd_key: new_value}` of the changed
state.
* `EVENT_APPLIANCE_UPDATE_RECEIVED` - Triggered after processing an ERD update message whether or not the state changed
* `EVENT_CONNECTED` - Triggered when the API connects, after adding basic subscriptions
* `EVENT_DISCONNECTED` - Triggered when the API disconnects
* `EVENT_GOT_APPLIANCE_LIST` - Triggered when we get the list of appliances
Expand Down
2 changes: 1 addition & 1 deletion gekitchen/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""GE Kitchen Appliances SDK"""

__version__ = "0.2.17"
__version__ = "0.2.18"


from .async_login_flow import (
Expand Down
2 changes: 2 additions & 0 deletions gekitchen/clients/websocket_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
API_URL,
EVENT_ADD_APPLIANCE,
EVENT_APPLIANCE_STATE_CHANGE,
EVENT_APPLIANCE_UPDATE_RECEIVED,
EVENT_CONNECTED,
EVENT_DISCONNECTED,
EVENT_GOT_APPLIANCE_LIST,
Expand Down Expand Up @@ -258,6 +259,7 @@ async def _update_appliance_state(self, mac_addr: str, updates: Dict[ErdCodeType
state_changes = appliance.update_erd_values(updates)
if state_changes:
await self.async_event(EVENT_APPLIANCE_STATE_CHANGE, [appliance, state_changes])
await self.async_event(EVENT_APPLIANCE_UPDATE_RECEIVED, updates)

async def disconnect(self):
"""Disconnect and cleanup."""
Expand Down
1 change: 1 addition & 0 deletions gekitchen/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
EVENT_ADD_APPLIANCE = "add_appliance"
EVENT_APPLIANCE_INITIAL_UPDATE = "appliance_got_type"
EVENT_APPLIANCE_STATE_CHANGE = "appliance_state_change"
EVENT_APPLIANCE_UPDATE_RECEIVED = "appliance_updated_received"
EVENT_CONNECTED = "connected"
EVENT_DISCONNECTED = "disconnected"
EVENT_GOT_APPLIANCE_LIST = "got_appliance_list"

0 comments on commit 240703e

Please sign in to comment.