Skip to content
This repository has been archived by the owner on May 2, 2023. It is now read-only.

Commit

Permalink
Group all entities under one device
Browse files Browse the repository at this point in the history
  • Loading branch information
davidlb committed Oct 25, 2021
1 parent 5098863 commit e1eafc5
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 3 deletions.
2 changes: 1 addition & 1 deletion custom_components/owntone_dleb/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
DEFAULT_SERVER_NAME = "My Server"
DEFAULT_UNMUTE_VOLUME = 0.6
DOMAIN = "owntone_dleb" # key for hass.data
FD_NAME = "owntone_dleb"
FD_NAME = "Owntone"
HASS_DATA_REMOVE_LISTENERS_KEY = "REMOVE_LISTENERS"
HASS_DATA_UPDATER_KEY = "UPDATER"
KNOWN_PIPES = {"librespot-java"}
Expand Down
4 changes: 2 additions & 2 deletions custom_components/owntone_dleb/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"domain": "owntone_dleb",
"name": "owntone",
"version": "0.1",
"name": "Owntone",
"version": "0.2",
"documentation": "https://www.home-assistant.io/integrations/forked_daapd",
"codeowners": ["@uvjustin", "@davidlb"],
"requirements": ["pyforked-daapd==0.1.11", "pylibrespot-java==0.1.0"],
Expand Down
16 changes: 16 additions & 0 deletions custom_components/owntone_dleb/media_player.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,13 @@ def unique_id(self):
"""Return unique ID."""
return f"{self._entry_id}-{self._output_id}"

@property
def device_info(self):
"""Return device info for this device."""
return {
"identifiers": {(DOMAIN, self._entry_id)},
}

@property
def should_poll(self) -> bool:
"""Entity pushes its state to HA."""
Expand Down Expand Up @@ -376,6 +383,15 @@ def unique_id(self):
"""Return unique ID."""
return self._config_entry.entry_id

@property
def device_info(self):
"""Return device info for this device."""
return {
"identifiers": {(DOMAIN, self.unique_id)},
"name": self.name,
"manufacturer": FD_NAME,
}

@property
def should_poll(self) -> bool:
"""Entity pushes its state to HA."""
Expand Down

0 comments on commit e1eafc5

Please sign in to comment.