Do not overwrite a custom hyperion light name with the hostname of the server. (#8391)

Do not overwrite a custom name with the hostname of the hyperion server.
Correct comment in name() method.

Fixes #8390
This commit is contained in:
James Marsh 2017-07-09 23:06:31 +01:00 committed by Pascal Vizeli
parent ec7ca9a560
commit 2ac423bd9d

View file

@ -62,7 +62,7 @@ class Hyperion(Light):
@property
def name(self):
"""Return the hostname of the server."""
"""Return the name of the light."""
return self._name
@property
@ -114,7 +114,8 @@ class Hyperion(Light):
"""Get the hostname of the remote."""
response = self.json_request({'command': 'serverinfo'})
if response:
self._name = response['info']['hostname']
if self._name == self._host:
self._name = response['info']['hostname']
return True
return False