Skip to content

Commit

Permalink
Handle scenario where no sensors are present in Backyard or Body of W…
Browse files Browse the repository at this point in the history
…ater.
  • Loading branch information
djtimca committed Jul 7, 2022
1 parent 8d09383 commit 9f296bf
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
7 changes: 5 additions & 2 deletions omnilogic/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1042,11 +1042,14 @@ async def get_telemetry_data(self):
if "Sensor" in config_item["Backyard"]:
sensors = config_item["Backyard"]["Sensor"]
else:
sensors = config_item["Backyard"]["Body-of-water"]["Sensor"]
if "Sensor" in config_item["Backyard"]["Body-of-water"]:
sensors = config_item["Backyard"]["Body-of-water"]["Sensor"]
else:
sensors = {}

hasAirSensor = False

if type(sensors) == dict:
if type(sensors) == dict and sensors != {}:
site_telem["Unit-of-Temperature"] = sensors.get("Units","UNITS_FAHRENHEIT")

if sensors["Name"] == "AirSensor":
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
setup(
name = 'omnilogic',
packages = ['omnilogic'],
version = '0.4.9',
version = '0.5.0',
license='apache-2.0',
description = 'Integration for the Hayward OmniLogic pool control system',
long_description = long_description,
long_description_content_type = "text/markdown",
author = 'Tim Empringham',
author_email = 'tim.empringham@live.ca',
url = 'https://github.com/djtimca/omnilogic-api',
download_url = 'https://github.com/djtimca/omnilogic-api/archive/v_049.tar.gz',
download_url = 'https://github.com/djtimca/omnilogic-api/archive/v_050.tar.gz',
keywords = ['OmniLogic', 'Hayward', 'Pool', 'Spa'],
install_requires=[
'xmltodict',
Expand Down

0 comments on commit 9f296bf

Please sign in to comment.