def write(self, circuit, message, value): """Call the ebusdpy API to write a value to the eBUS device.""" with self._lock: try: _LOGGER.debug("ebus write (hub %s, IP %s:%i): write -c %s %s %d", self._name, self._ipaddress, self._port, circuit, message, value) command_result = ebusdpy.write((self._ipaddress, self._port), circuit, message, value) if command_result is not None: if "done" not in command_result: _LOGGER.warning("ebus write error: write command failed") except RuntimeError as err: _LOGGER.error(err)
def write(self, call): """Call write methon on ebusd.""" name = call.data.get("name") value = call.data.get("value") try: _LOGGER.debug("Opening socket to ebusd %s", name) command_result = ebusdpy.write(self._address, self._circuit, name, value) if command_result is not None and "done" not in command_result: _LOGGER.warning("Write command failed: %s", name) except RuntimeError as err: _LOGGER.error(err)
def write(self, call): """Call write methon on ebusd.""" import ebusdpy name = call.data.get('name') value = call.data.get('value') try: _LOGGER.debug("Opening socket to ebusd %s", name) command_result = ebusdpy.write( self._address, self._circuit, name, value) if command_result is not None: if 'done' not in command_result: _LOGGER.warning('Write command failed: %s', name) except RuntimeError as err: _LOGGER.error(err)