Add device registry support for Plex (#31797)
* Add device registry support for Plex * Fix model * Use Plex server as sensor device identifier
This commit is contained in:
parent
f0b2d50e41
commit
408b41ea02
4 changed files with 47 additions and 0 deletions
|
@ -142,3 +142,17 @@ class PlexSensor(Entity):
|
|||
now_playing.append((now_playing_user, now_playing_title))
|
||||
self._state = len(self.sessions)
|
||||
self._now_playing = now_playing
|
||||
|
||||
@property
|
||||
def device_info(self):
|
||||
"""Return a device description for device registry."""
|
||||
if self.unique_id is None:
|
||||
return None
|
||||
|
||||
return {
|
||||
"identifiers": {(PLEX_DOMAIN, self._server.machine_identifier)},
|
||||
"manufacturer": "Plex",
|
||||
"model": "Plex Media Server",
|
||||
"name": "Activity Sensor",
|
||||
"sw_version": self._server.version,
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue