Skip to content

Commit 6b9afd0

Browse files
Khole JonesKhole Jones
authored andcommitted
fix trv fix
1 parent 181f4d9 commit 6b9afd0

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

pyhiveapi/apyhiveapi/helper/hive_helper.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ def getDeviceData(self, product: dict):
8181
Returns:
8282
[type]: Device data.
8383
"""
84-
device_id = product["id"]
84+
device = product
8585
type = product["type"]
8686
if type in ("heating", "hotwater"):
8787
for aDevice in self.session.data.devices:
@@ -91,23 +91,23 @@ def getDeviceData(self, product: dict):
9191
product["props"]["zone"]
9292
== self.session.data.devices[aDevice]["props"]["zone"]
9393
):
94-
device_id = self.session.data.devices[aDevice]["id"]
94+
device = self.session.data.devices[aDevice]
9595
except KeyError:
9696
pass
9797
elif type == "trvcontrol":
9898
trv_present = len(product["props"]["trvs"]) > 0
9999
if trv_present:
100-
device_id = self.session.data.devices[product["props"]["trvs"][0]]["id"]
100+
device = self.session.data.devices[product["props"]["trvs"][0]]
101101
else:
102102
raise KeyError
103103
elif type == "warmwhitelight" and product["props"]["model"] == "SIREN001":
104-
device_id = self.session.data.devices[product["parent"]]
104+
device = self.session.data.devices[product["parent"]]
105105
elif type == "sense":
106-
device_id = self.session.data.devices[product["parent"]]
106+
device = self.session.data.devices[product["parent"]]
107107
else:
108-
device_id = self.session.data.devices[product["id"]]
108+
device = self.session.data.devices[product["id"]]
109109

110-
return device_id
110+
return device
111111

112112
def convertMinutesToTime(self, minutes_to_convert: str):
113113
"""Convert minutes string to datetime.

pyhiveapi/apyhiveapi/session.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -540,7 +540,7 @@ async def createDevices(self):
540540
try:
541541
eval("self." + code)
542542
except (NameError, AttributeError) as e:
543-
self.log.warning(f"Device {product_name} cannot be setup - {e}")
543+
self.logger.warning(f"Device {product_name} cannot be setup - {e}")
544544
pass
545545

546546
if self.data.products[aProduct]["type"] in hive_type:

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def requirements_from_file(filename="requirements.txt"):
1616

1717

1818
setup(
19-
version="1.0.0",
19+
version="1.0.1",
2020
package_data={"data": ["*.json"]},
2121
include_package_data=True,
2222
cmdclass={

0 commit comments

Comments
 (0)