Skip to content

Commit cb9856c

Browse files
Khole JonesKhole Jones
authored andcommitted
Fix parent issue
1 parent ad7cbcd commit cb9856c

3 files changed

Lines changed: 11 additions & 7 deletions

File tree

.pre-commit-config.yaml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,10 @@ repos:
6161
- id: no-commit-to-branch
6262
args:
6363
- --branch=master
64-
- repo: local
64+
- repo: https://github.com/pycqa/pylint
65+
rev: v3.3.1
6566
hooks:
6667
- id: pylint
67-
name: pylint
68-
entry: pylint
69-
language: system
70-
types: [python]
7168
args: [
7269
"-rn", # Only display messages
7370
"-sn", # Don't display the score

pyhiveapi/apyhiveapi/session.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,8 +154,14 @@ def addList(self, entityType: str, data: dict, **kwargs: dict):
154154
kwargs["haName"] = device_name + kwargs["haName"]
155155
else:
156156
formatted_data["haName"] = device_name
157+
157158
formatted_data.update(kwargs)
158-
self.deviceList[entityType].append(formatted_data)
159+
160+
if data.get("type", "") == "hub":
161+
self.devices["parent"].append(formatted_data)
162+
else:
163+
self.deviceList[entityType].append(formatted_data)
164+
159165
return formatted_data
160166
except KeyError as error:
161167
self.logger.error(error)
@@ -515,6 +521,7 @@ async def createDevices(self):
515521
Returns:
516522
list: List of devices
517523
"""
524+
self.deviceList["parent"] = []
518525
self.deviceList["alarm_control_panel"] = []
519526
self.deviceList["binary_sensor"] = []
520527
self.deviceList["camera"] = []

setup.py

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

1818

1919
setup(
20-
version="1.0.3",
20+
version="1.0.4",
2121
package_data={"data": ["*.json"]},
2222
include_package_data=True,
2323
cmdclass={

0 commit comments

Comments
 (0)