Remove hidden property from xiaomi_miio.remote integration (#30727)
This commit is contained in:
parent
15645ab0c9
commit
56dc5298fc
1 changed files with 2 additions and 27 deletions
|
@ -16,7 +16,6 @@ from homeassistant.components.remote import (
|
|||
)
|
||||
from homeassistant.const import (
|
||||
ATTR_ENTITY_ID,
|
||||
ATTR_HIDDEN,
|
||||
CONF_COMMAND,
|
||||
CONF_HOST,
|
||||
CONF_NAME,
|
||||
|
@ -61,7 +60,6 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(
|
|||
vol.Optional(CONF_SLOT, default=DEFAULT_SLOT): vol.All(
|
||||
int, vol.Range(min=1, max=1000000)
|
||||
),
|
||||
vol.Optional(ATTR_HIDDEN, default=True): cv.boolean,
|
||||
vol.Required(CONF_TOKEN): vol.All(str, vol.Length(min=32, max=32)),
|
||||
vol.Optional(CONF_COMMANDS, default={}): cv.schema_with_slug_keys(
|
||||
COMMAND_SCHEMA
|
||||
|
@ -106,16 +104,8 @@ async def async_setup_platform(hass, config, async_add_entities, discovery_info=
|
|||
slot = config.get(CONF_SLOT)
|
||||
timeout = config.get(CONF_TIMEOUT)
|
||||
|
||||
hidden = config.get(ATTR_HIDDEN)
|
||||
|
||||
xiaomi_miio_remote = XiaomiMiioRemote(
|
||||
friendly_name,
|
||||
device,
|
||||
unique_id,
|
||||
slot,
|
||||
timeout,
|
||||
hidden,
|
||||
config.get(CONF_COMMANDS),
|
||||
friendly_name, device, unique_id, slot, timeout, config.get(CONF_COMMANDS),
|
||||
)
|
||||
|
||||
hass.data[DATA_KEY][host] = xiaomi_miio_remote
|
||||
|
@ -178,14 +168,11 @@ async def async_setup_platform(hass, config, async_add_entities, discovery_info=
|
|||
class XiaomiMiioRemote(RemoteDevice):
|
||||
"""Representation of a Xiaomi Miio Remote device."""
|
||||
|
||||
def __init__(
|
||||
self, friendly_name, device, unique_id, slot, timeout, hidden, commands
|
||||
):
|
||||
def __init__(self, friendly_name, device, unique_id, slot, timeout, commands):
|
||||
"""Initialize the remote."""
|
||||
self._name = friendly_name
|
||||
self._device = device
|
||||
self._unique_id = unique_id
|
||||
self._is_hidden = hidden
|
||||
self._slot = slot
|
||||
self._timeout = timeout
|
||||
self._state = False
|
||||
|
@ -206,11 +193,6 @@ class XiaomiMiioRemote(RemoteDevice):
|
|||
"""Return the remote object."""
|
||||
return self._device
|
||||
|
||||
@property
|
||||
def hidden(self):
|
||||
"""Return if we should hide entity."""
|
||||
return self._is_hidden
|
||||
|
||||
@property
|
||||
def slot(self):
|
||||
"""Return the slot to save learned command."""
|
||||
|
@ -235,13 +217,6 @@ class XiaomiMiioRemote(RemoteDevice):
|
|||
"""We should not be polled for device up state."""
|
||||
return False
|
||||
|
||||
@property
|
||||
def device_state_attributes(self):
|
||||
"""Hide remote by default."""
|
||||
if self._is_hidden:
|
||||
return {"hidden": "true"}
|
||||
return
|
||||
|
||||
async def async_turn_on(self, **kwargs):
|
||||
"""Turn the device on."""
|
||||
_LOGGER.error(
|
||||
|
|
Loading…
Add table
Reference in a new issue