Skip to content

Commit

Permalink
fix: adjust to firmware updates
Browse files Browse the repository at this point in the history
  • Loading branch information
dgomes committed Feb 25, 2024
1 parent 7af0c7a commit fea4ebf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
7 changes: 4 additions & 3 deletions custom_components/openhasp/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
DISCOVERED_MANUFACTURER,
DISCOVERED_MODEL,
DISCOVERED_NODE,
DISCOVERED_NODE_T,
DISCOVERED_PAGES,
DISCOVERED_POWER,
DISCOVERED_URL,
Expand Down Expand Up @@ -85,10 +86,10 @@ async def async_step_user(self, user_input=None):
return self.async_abort(reason="discovery_only")

async def async_step_zeroconf(self, discovery_info=None):
_discovered = json.loads(discovery_info.properties.get("discovery"))
_LOGGER.error("Discovered ZeroConf: %s", _discovered)
_discovered = discovery_info.properties
_LOGGER.debug("Discovered ZeroConf: %s", _discovered)

_discovered[CONF_TOPIC] = f"{DEFAULT_TOPIC}/{_discovered[DISCOVERED_NODE]}"
_discovered[CONF_TOPIC] = _discovered[DISCOVERED_NODE_T][:-1]

return await self._process_discovery(_discovered)

Expand Down
1 change: 1 addition & 0 deletions custom_components/openhasp/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
DEFAULT_IDLE_BRIGHNESS = 25

DISCOVERED_NODE = "node"
DISCOVERED_NODE_T = "node_t"
DISCOVERED_MODEL = "mdl"
DISCOVERED_MANUFACTURER = "mf"
DISCOVERED_HWID = "hwid"
Expand Down

0 comments on commit fea4ebf

Please sign in to comment.