Skip to content

Commit

Permalink
Fixed Home Assistant discovery JSON Errors #30
Browse files Browse the repository at this point in the history
  • Loading branch information
bkbilly committed Jan 3, 2023
1 parent 8889f22 commit 9345388
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion lnxlink/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,8 @@ def setup_discovery_monitoring(self, addon, service, discovery_template):
discovery['name'] = addon.name.lower().replace(' ', '_')
discovery['unique_id'] = f"{self.config['mqtt']['clientId']}_{service}"
discovery['state_topic'] = topic
discovery['json_attributes_topic'] = topic
if addon.getInfo.__annotations__.get('return') == dict:
discovery['json_attributes_topic'] = topic
discovery['icon'] = addon.icon
discovery['unit_of_measurement'] = addon.unit
if hasattr(addon, 'device_class'):
Expand Down
2 changes: 1 addition & 1 deletion lnxlink/modules/media.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def startControl(self, topic, data):
if len(self.players) > 0:
self.players[0]['player'].Next()

def getInfo(self):
def getInfo(self) -> dict:
self.__getPlayers()
info = {
'title': '',
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "lnxlink"
version = "2022.12.0"
version = "2023.1.0"
description = "Internet Of Things (IOT) integration with Linux using MQTT"
readme = "README.md"
keywords = ["lnxlink"]
Expand Down

0 comments on commit 9345388

Please sign in to comment.