Skip to content

Commit

Permalink
Return debug logging for devices
Browse files Browse the repository at this point in the history
  • Loading branch information
sebr committed Aug 30, 2022
1 parent 1e6dc0f commit 18f747e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions custom_components/bhyve/config_flow.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""Config flow for BHyve integration."""
from __future__ import annotations

import json
import logging
from typing import Any

Expand Down Expand Up @@ -204,8 +205,7 @@ async def async_step_init(self, user_input=None):
except BHyveError:
return self.async_abort(reason="cannot_connect")

# _LOGGER.debug("Devices: %s", json.dumps(devices))
# _LOGGER.debug("Programs: %s", json.dumps(programs))
_LOGGER.debug("Devices: %s", json.dumps(devices))

# _LOGGER.debug("ALL DEVICES")
# _LOGGER.debug(str(self.config_entry.options))
Expand Down
12 changes: 6 additions & 6 deletions debug/debug.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,18 @@

script_dir = os.path.dirname(os.path.realpath(__file__))

devices_json = os.path.join(script_dir, folder + "/devices.json")
diagnostics_json = os.path.join(script_dir, folder + "/diagnostics.json")

with open(devices_json) as devicesFile:
devices = json.load(devicesFile)
devicesFile.close()
with open(diagnostics_json) as diagnosticsFile:
diagnostics = json.load(diagnosticsFile)
diagnosticsFile.close()


for device in devices:
for device in diagnostics.get("data").get("devices"):
if device.get("type") == "bridge":
continue

name = device.get("name")
print("")

if device.get("type") == "sprinkler_timer":
zones = device.get("zones")
Expand Down

0 comments on commit 18f747e

Please sign in to comment.