mirror of
https://github.com/home-assistant/core.git
synced 2025-07-21 20:27:08 +00:00
Set Roku name to the device name instead of the serial number (#5475)
This commit is contained in:
parent
db97ad4485
commit
58b698400e
@ -69,10 +69,10 @@ class RokuDevice(MediaPlayerDevice):
|
|||||||
from roku import Roku
|
from roku import Roku
|
||||||
|
|
||||||
self.roku = Roku(host)
|
self.roku = Roku(host)
|
||||||
self.roku_name = None
|
|
||||||
self.ip_address = host
|
self.ip_address = host
|
||||||
self.channels = []
|
self.channels = []
|
||||||
self.current_app = None
|
self.current_app = None
|
||||||
|
self.device_info = {}
|
||||||
|
|
||||||
self.update()
|
self.update()
|
||||||
|
|
||||||
@ -81,7 +81,7 @@ class RokuDevice(MediaPlayerDevice):
|
|||||||
import requests.exceptions
|
import requests.exceptions
|
||||||
|
|
||||||
try:
|
try:
|
||||||
self.roku_name = "roku_" + self.roku.device_info.sernum
|
self.device_info = self.roku.device_info
|
||||||
self.ip_address = self.roku.host
|
self.ip_address = self.roku.host
|
||||||
self.channels = self.get_source_list()
|
self.channels = self.get_source_list()
|
||||||
|
|
||||||
@ -106,7 +106,7 @@ class RokuDevice(MediaPlayerDevice):
|
|||||||
@property
|
@property
|
||||||
def name(self):
|
def name(self):
|
||||||
"""Return the name of the device."""
|
"""Return the name of the device."""
|
||||||
return self.roku_name
|
return self.device_info.userdevicename
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def state(self):
|
def state(self):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user