Move data on import in rfxtrx integration into ConfigEntry (#38022)
* Move all data imported from yaml to ConfigEntry * Revert changes that prevent updating yaml entry * Cleanup code around time conversion
This commit is contained in:
parent
60009ec2f9
commit
d9dba9142c
8 changed files with 23 additions and 32 deletions
|
@ -24,12 +24,7 @@ from . import (
|
|||
get_pt2262_cmd,
|
||||
get_rfx_object,
|
||||
)
|
||||
from .const import (
|
||||
COMMAND_OFF_LIST,
|
||||
COMMAND_ON_LIST,
|
||||
DATA_RFXTRX_CONFIG,
|
||||
DEVICE_PACKET_TYPE_LIGHTING4,
|
||||
)
|
||||
from .const import COMMAND_OFF_LIST, COMMAND_ON_LIST, DEVICE_PACKET_TYPE_LIGHTING4
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
|
@ -43,7 +38,7 @@ async def async_setup_entry(
|
|||
device_ids = set()
|
||||
pt2262_devices = []
|
||||
|
||||
discovery_info = hass.data[DATA_RFXTRX_CONFIG]
|
||||
discovery_info = config_entry.data
|
||||
|
||||
def supported(event):
|
||||
return isinstance(event, rfxtrxmod.ControlEvent)
|
||||
|
@ -197,5 +192,5 @@ class RfxtrxBinarySensor(RfxtrxEntity, BinarySensorEntity):
|
|||
self.async_write_ha_state()
|
||||
|
||||
self._delay_listener = evt.async_call_later(
|
||||
self.hass, self._off_delay.total_seconds(), off_delay_listener
|
||||
self.hass, self._off_delay, off_delay_listener
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue