Skip to content

Commit 9f296bf

Browse files
committed
Handle scenario where no sensors are present in Backyard or Body of Water.
1 parent 8d09383 commit 9f296bf

2 files changed

Lines changed: 7 additions & 4 deletions

File tree

omnilogic/__init__.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1042,11 +1042,14 @@ async def get_telemetry_data(self):
10421042
if "Sensor" in config_item["Backyard"]:
10431043
sensors = config_item["Backyard"]["Sensor"]
10441044
else:
1045-
sensors = config_item["Backyard"]["Body-of-water"]["Sensor"]
1045+
if "Sensor" in config_item["Backyard"]["Body-of-water"]:
1046+
sensors = config_item["Backyard"]["Body-of-water"]["Sensor"]
1047+
else:
1048+
sensors = {}
10461049

10471050
hasAirSensor = False
10481051

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

10521055
if sensors["Name"] == "AirSensor":

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@
66
setup(
77
name = 'omnilogic',
88
packages = ['omnilogic'],
9-
version = '0.4.9',
9+
version = '0.5.0',
1010
license='apache-2.0',
1111
description = 'Integration for the Hayward OmniLogic pool control system',
1212
long_description = long_description,
1313
long_description_content_type = "text/markdown",
1414
author = 'Tim Empringham',
1515
author_email = 'tim.empringham@live.ca',
1616
url = 'https://github.com/djtimca/omnilogic-api',
17-
download_url = 'https://github.com/djtimca/omnilogic-api/archive/v_049.tar.gz',
17+
download_url = 'https://github.com/djtimca/omnilogic-api/archive/v_050.tar.gz',
1818
keywords = ['OmniLogic', 'Hayward', 'Pool', 'Spa'],
1919
install_requires=[
2020
'xmltodict',

0 commit comments

Comments
 (0)