Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
flatsiedatsie authored Feb 11, 2023
1 parent a542d0e commit b9aaaba
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 deletions.
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
}
},
"short_name": "matter",
"version": "0.1.0",
"version": "0.1.1",
"web_accessible_resources": [
"css/*.css",
"images/*.svg",
Expand Down
22 changes: 19 additions & 3 deletions pkg/matter_device.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def __init__(self, adapter, device_id, node):
self.name = device_id
self.adapter = adapter
self.DEBUG = adapter.DEBUG
self.title = 'Matter addon thing'
self.title = 'Matter device'
self.description = 'This is a Matter device'
self._type = [] # holds capacilities

Expand Down Expand Up @@ -137,7 +137,7 @@ def __init__(self, adapter, device_id, node):
print("\n\n\n")


# MAIN ATTRIBUTES TO PROPERTIES LOOP
# MAIN ATTRIBUTES TO PROPERTIES LOOP

# Loop over all the node's attributes and only pay attention to the ones that are important
for attribute_code in node['attributes'].keys():
Expand Down Expand Up @@ -529,8 +529,24 @@ def add_device_capability():
self.data_mute,
{'attribute_id':'data_mute'})



# Update device title

try:
better_title = ""
if 'product_name' in self.adapter.persistent_data['nodez'][device_id]:
better_title = str(self.adapter.persistent_data['nodez'][device_id]['product_name'])

#if 'vendor_name' in self.adapter.persistent_data['nodez'][device_id]:
# better_title = str(self.adapter.persistent_data['nodez'][device_id]['vendor_name']) + " " + better_title

if len(better_title) > 5:
self.title = better_title

except Exception as ex:
print("Error generating better device title")


"""
client: on_message: {
"message_id": "get_nodes",
Expand Down

0 comments on commit b9aaaba

Please sign in to comment.