Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
dgomes committed Dec 12, 2021
1 parent f5f6dff commit c51ed32
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions custom_components/openhasp/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,14 @@ async def async_step_user(self, user_input=None):
_LOGGER.error("Discovery Only")

await self.hass.components.mqtt.async_publish(
"hasp/broadcast/command/discovery", "discovery", qos=0, retain=False
self.hass, "hasp/broadcast/command/discovery", "discovery", qos=0, retain=False
)

return self.async_abort(reason="discovery_only")

async def async_step_mqtt(self, discovery_info=None):
"""Handle a flow initialized by MQTT discovery."""
_discovered = json.loads(discovery_info["payload"])
_discovered = json.loads(discovery_info.payload)
_LOGGER.debug("Discovered: %s", _discovered)

hwid = _discovered[DISCOVERED_HWID]
Expand All @@ -106,7 +106,7 @@ async def async_step_mqtt(self, discovery_info=None):
]
self.config_data[
CONF_TOPIC
] = f"{discovery_info['topic'].split('/')[0]}/{self.config_data[CONF_NODE]}"
] = f"{discovery_info.topic.split('/')[0]}/{self.config_data[CONF_NODE]}"

self.config_data[DISCOVERED_URL] = _discovered.get(DISCOVERED_URL)
self.config_data[DISCOVERED_MANUFACTURER] = _discovered.get(
Expand Down

0 comments on commit c51ed32

Please sign in to comment.