You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Authentication flow has been improved quite a bit but it would benefit a lot from real-world feedback.
129
+
- For now there are only read calls. Next up is implementing ~all hub calls at the raw level and then wrapping them for ease of use. If there's something you want to use sooner than later file an issue so it can get prioritized!
130
+
- Device model is non-existant and the old implementations are bad and deprecated. Active work ongoing to filter by capability at a low level first, then perhaps a more object oriented model on top of that.
"""Get up to date full devices data set as a dict. Optionally can be filtered to only include certain devices.
50
52
51
53
Args:
52
-
capability(cozify.hub.capability): Capability to filter by, for example: cozify.hub.capability.TEMPERATURE. Defaults to no filtering.
54
+
capabilities(cozify.hub.capability): Single or list of cozify.hub.capability types to filter by, for example: [ cozify.hub.capability.TEMPERATURE, cozify.hub.capability.HUMIDITY ]. Defaults to no filtering.
55
+
and_filter(bool): Multi-filter by AND instead of default OR. Defaults to False.
53
56
**hub_name(str): optional name of hub to query. Will get converted to hubId for use.
54
57
**hub_id(str): optional id of hub to query. A specified hub_id takes presedence over a hub_name or default Hub. Providing incorrect hub_id's will create cruft in your state but it won't hurt anything beyond failing the current operation.
commit(bool): True to commit state after set. Defaults to True.
148
160
"""
149
161
section='Hubs.'+hub_id
150
-
ifsectioninc.state:
151
-
ifattrnotinc.state[section]:
162
+
ifsectioninconfig.state:
163
+
ifattrnotinconfig.state[section]:
152
164
logging.info("Attribute {0} was not already in {1} state, new attribute created.".format(attr, section))
153
-
c.state[section][attr] =value
165
+
config.state[section][attr] =value
154
166
ifcommit:
155
-
c.stateWrite()
167
+
config.stateWrite()
156
168
else:
157
169
logging.warning('Section {0} not found in state.'.format(section))
158
170
raiseAttributeError
@@ -176,7 +188,7 @@ def host(hub_id):
176
188
hub_id(str): Id of hub to query. The id is a string of hexadecimal sections used internally to represent a hub.
177
189
178
190
Returns:
179
-
str: ip address of matching hub. Be aware that this may be empty if the hub is only known remotely and will still give you an ip address even if the hub is currently remote.
191
+
str: ip address of matching hub. Be aware that this may be empty if the hub is only known remotely and will still give you an ip address even if the hub is currently remote and an ip address was previously locally known.
0 commit comments