mirror of
https://github.com/home-assistant/core.git
synced 2025-07-22 20:57:21 +00:00
Remove hidden property from emby integration (#30729)
This commit is contained in:
parent
c8a52d4566
commit
0c14d4e067
@ -36,8 +36,6 @@ import homeassistant.util.dt as dt_util
|
|||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
CONF_AUTO_HIDE = "auto_hide"
|
|
||||||
|
|
||||||
MEDIA_TYPE_TRAILER = "trailer"
|
MEDIA_TYPE_TRAILER = "trailer"
|
||||||
MEDIA_TYPE_GENERIC_VIDEO = "video"
|
MEDIA_TYPE_GENERIC_VIDEO = "video"
|
||||||
|
|
||||||
@ -45,7 +43,6 @@ DEFAULT_HOST = "localhost"
|
|||||||
DEFAULT_PORT = 8096
|
DEFAULT_PORT = 8096
|
||||||
DEFAULT_SSL_PORT = 8920
|
DEFAULT_SSL_PORT = 8920
|
||||||
DEFAULT_SSL = False
|
DEFAULT_SSL = False
|
||||||
DEFAULT_AUTO_HIDE = False
|
|
||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
@ -61,7 +58,6 @@ SUPPORT_EMBY = (
|
|||||||
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(
|
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(
|
||||||
{
|
{
|
||||||
vol.Required(CONF_API_KEY): cv.string,
|
vol.Required(CONF_API_KEY): cv.string,
|
||||||
vol.Optional(CONF_AUTO_HIDE, default=DEFAULT_AUTO_HIDE): cv.boolean,
|
|
||||||
vol.Optional(CONF_HOST, default=DEFAULT_HOST): cv.string,
|
vol.Optional(CONF_HOST, default=DEFAULT_HOST): cv.string,
|
||||||
vol.Optional(CONF_PORT): cv.port,
|
vol.Optional(CONF_PORT): cv.port,
|
||||||
vol.Optional(CONF_SSL, default=DEFAULT_SSL): cv.boolean,
|
vol.Optional(CONF_SSL, default=DEFAULT_SSL): cv.boolean,
|
||||||
@ -76,7 +72,6 @@ async def async_setup_platform(hass, config, async_add_entities, discovery_info=
|
|||||||
key = config.get(CONF_API_KEY)
|
key = config.get(CONF_API_KEY)
|
||||||
port = config.get(CONF_PORT)
|
port = config.get(CONF_PORT)
|
||||||
ssl = config.get(CONF_SSL)
|
ssl = config.get(CONF_SSL)
|
||||||
auto_hide = config.get(CONF_AUTO_HIDE)
|
|
||||||
|
|
||||||
if port is None:
|
if port is None:
|
||||||
port = DEFAULT_SSL_PORT if ssl else DEFAULT_PORT
|
port = DEFAULT_SSL_PORT if ssl else DEFAULT_PORT
|
||||||
@ -109,7 +104,6 @@ async def async_setup_platform(hass, config, async_add_entities, discovery_info=
|
|||||||
active_emby_devices[dev_id] = add
|
active_emby_devices[dev_id] = add
|
||||||
_LOGGER.debug("Showing %s, item: %s", dev_id, add)
|
_LOGGER.debug("Showing %s, item: %s", dev_id, add)
|
||||||
add.set_available(True)
|
add.set_available(True)
|
||||||
add.set_hidden(False)
|
|
||||||
|
|
||||||
if new_devices:
|
if new_devices:
|
||||||
_LOGGER.debug("Adding new devices: %s", new_devices)
|
_LOGGER.debug("Adding new devices: %s", new_devices)
|
||||||
@ -123,8 +117,6 @@ async def async_setup_platform(hass, config, async_add_entities, discovery_info=
|
|||||||
inactive_emby_devices[data] = rem
|
inactive_emby_devices[data] = rem
|
||||||
_LOGGER.debug("Inactive %s, item: %s", data, rem)
|
_LOGGER.debug("Inactive %s, item: %s", data, rem)
|
||||||
rem.set_available(False)
|
rem.set_available(False)
|
||||||
if auto_hide:
|
|
||||||
rem.set_hidden(True)
|
|
||||||
|
|
||||||
@callback
|
@callback
|
||||||
def start_emby(event):
|
def start_emby(event):
|
||||||
@ -152,7 +144,6 @@ class EmbyDevice(MediaPlayerDevice):
|
|||||||
self.device_id = device_id
|
self.device_id = device_id
|
||||||
self.device = self.emby.devices[self.device_id]
|
self.device = self.emby.devices[self.device_id]
|
||||||
|
|
||||||
self._hidden = False
|
|
||||||
self._available = True
|
self._available = True
|
||||||
|
|
||||||
self.media_status_last_position = None
|
self.media_status_last_position = None
|
||||||
@ -177,15 +168,6 @@ class EmbyDevice(MediaPlayerDevice):
|
|||||||
|
|
||||||
self.async_schedule_update_ha_state()
|
self.async_schedule_update_ha_state()
|
||||||
|
|
||||||
@property
|
|
||||||
def hidden(self):
|
|
||||||
"""Return True if entity should be hidden from UI."""
|
|
||||||
return self._hidden
|
|
||||||
|
|
||||||
def set_hidden(self, value):
|
|
||||||
"""Set hidden property."""
|
|
||||||
self._hidden = value
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def available(self):
|
def available(self):
|
||||||
"""Return True if entity is available."""
|
"""Return True if entity is available."""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user