예제 #1
0
 def __init__(self, request, message_delay_zero):
     """Initialize the class."""
     request.addfinalizer(self.fin)
     self.reader = None
     self.writer = None
     self.server = None
     self.in_buffer = bytearray()
     self.new_dev_func = Mock()
     self.update_dev_func = Mock()
     self.exceptions = []
     if message_delay_zero:
         with patch("dynalite_devices_lib.dynalite.MESSAGE_DELAY", 0):
             self.dyn_dev = DynaliteDevices(
                 new_device_func=self.new_dev_func,
                 update_device_func=self.update_dev_func,
             )
     else:
         self.dyn_dev = DynaliteDevices(
             new_device_func=self.new_dev_func,
             update_device_func=self.update_dev_func,
         )
예제 #2
0
 def __init__(self, hass: HomeAssistant, config: dict[str, Any]) -> None:
     """Initialize the system based on host parameter."""
     self.hass = hass
     self.async_add_devices: dict[str, Callable] = {}
     self.waiting_devices: dict[str, list[str]] = {}
     self.host = config[CONF_HOST]
     # Configure the dynalite devices
     self.dynalite_devices = DynaliteDevices(
         new_device_func=self.add_devices_when_registered,
         update_device_func=self.update_device,
         notification_func=self.handle_notification,
     )
     self.dynalite_devices.configure(config)
예제 #3
0
 def __init__(self, hass, config):
     """Initialize the system based on host parameter."""
     self.hass = hass
     self.area = {}
     self.async_add_devices = {}
     self.waiting_devices = {}
     self.host = config[CONF_HOST]
     # Configure the dynalite devices
     self.dynalite_devices = DynaliteDevices(
         new_device_func=self.add_devices_when_registered,
         update_device_func=self.update_device,
     )
     self.dynalite_devices.configure(config)
예제 #4
0
 def __init__(self, hass: HomeAssistant, config: Dict[str, Any]) -> None:
     """Initialize the system based on host parameter."""
     self.hass = hass
     self.area = {}
     self.async_add_devices = {}
     self.waiting_devices = {}
     self.host = config[CONF_HOST]
     # Configure the dynalite devices
     self.dynalite_devices = DynaliteDevices(
         new_device_func=self.add_devices_when_registered,
         update_device_func=self.update_device,
     )
     self.dynalite_devices.configure(convert_config(config))
예제 #5
0
 def __init__(self, opp: OpenPeerPower, config: dict[str, Any]) -> None:
     """Initialize the system based on host parameter."""
     self.opp = opp
     self.area = {}
     self.async_add_devices = {}
     self.waiting_devices = {}
     self.host = config[CONF_HOST]
     # Configure the dynalite devices
     self.dynalite_devices = DynaliteDevices(
         new_device_func=self.add_devices_when_registered,
         update_device_func=self.update_device,
         notification_func=self.handle_notification,
     )
     self.dynalite_devices.configure(convert_config(config))