Enhance MQTT client configuration with improved naming, icons, and additional URL

This commit is contained in:
Edgar P. Burkhart 2025-03-09 17:31:16 +01:00
parent 204e0a1fbc
commit 45f7fc4741
Signed by: edpibu
GPG key ID: 9833D3C5A25BD227

View file

@ -108,10 +108,11 @@ class HassClient(Client):
return {
"dev": {
"ids": self.node_id,
"name": self.node_id,
"name": self.node_id.capitalize(),
},
"o": {
"name": "hasspy",
"name": "HassPy",
"url": "https://git.edgarpierre.fr/edpibu/hasspy",
},
"cmps": self.components,
"availability_topic": self.availability_topic,
@ -154,14 +155,16 @@ class HassSystemClient(HassClient):
"unique_id": f"{self.node_id}_power",
"p": "switch",
"name": "Power",
"icon": "mdi:power",
"payload_off": "POWER_OFF",
"payload_on": "POWER_ON",
"value_template": "{{ value_json.power }}",
},
"lock": {
"unique_id": f"{self.node_id}_power",
"unique_id": f"{self.node_id}_lock",
"p": "button",
"name": "Lock",
"icon": "mdi:account-lock",
"payload_press": "LOCK",
},
}
@ -213,12 +216,14 @@ class HassUserClient(HassClient):
"unique_id": f"{self.node_id}_play_pause",
"p": "button",
"name": "Play/Pause",
"icon": "mdi:play-pause",
"payload_press": "PLAY_PAUSE",
},
"volume": {
"unique_id": f"{self.node_id}_volume",
"p": "number",
"name": "Volume",
"icon": "mdi:volume-high",
"command_template": "VOLUME:{{ value }}",
"step": 10,
"min": 0,