def apply(self): self._updating = True try: cmd = set_command(self.type) cmd.prompt_tone = self._prompt_tone cmd.power_state = self._power_state cmd.target_temperature = self._target_temperature cmd.operational_mode = self._operational_mode.value cmd.fan_speed = self._fan_speed cmd.swing_mode = self._swing_mode.value cmd.eco_mode = self._eco_mode cmd.turbo_mode = self._turbo_mode pkt_builder = packet_builder(self.id) # cmd.night_light = False cmd.fahrenheit = self.farenheit_unit pkt_builder.set_command(cmd) data = pkt_builder.finalize() data = self._lan_service.appliance_transparent_send(data) _LOGGER.debug("apply - Recieved from {}, {}: {}".format( self.ip, self.id, data.hex())) if len(data) > 0: response = appliance_response(data) self._support = True if not self._defer_update: self.update(response) finally: self._updating = False self._defer_update = False
def apply(self): self._updating = True try: cmd = set_command(self.type) cmd.prompt_tone = self._prompt_tone cmd.power_state = self._power_state cmd.target_temperature = self._target_temperature cmd.operational_mode = self._operational_mode.value cmd.fan_speed = self._fan_speed.value cmd.swing_mode = self._swing_mode.value cmd.eco_mode = self._eco_mode cmd.turbo_mode = self._turbo_mode # cmd.temp_unit_f() print(f"0x09 byte was {cmd.data[0x09]}") pkt_builder = packet_builder(self.id) pkt_builder.set_command(cmd) data = pkt_builder.finalize() data = self._lan_service.appliance_transparent_send(data) _LOGGER.debug("apply - Recieved from {}, {}: {}".format( self.ip, self.id, data.hex())) if len(data) > 0: response = appliance_response(data) if not self._defer_update: self.update(response) print(f"updated device to:{self}") finally: self._updating = False self._defer_update = False
def apply(self): self._updating = True try: cmd = set_command(self.type) cmd.prompt_tone = self._prompt_tone cmd.power_state = self._power_state cmd.target_temperature = self._target_temperature cmd.operational_mode = self._operational_mode.value cmd.fan_speed = self._fan_speed.value cmd.swing_mode = self._swing_mode.value cmd.eco_mode = self._eco_mode cmd.turbo_mode = self._turbo_mode # pkt_builder = packet_builder(self.id) # cmd.night_light = False cmd.fahrenheit = self.farenheit_unit self._send_cmd(cmd) finally: self._updating = False self._defer_update = False
def apply(self): self._updating = True try: cmd = set_command(self.type) cmd.audible_feedback = self._audible_feedback cmd.power_state = self._power_state cmd.target_temperature = self._target_temperature cmd.operational_mode = self._operational_mode.value cmd.fan_speed = self._fan_speed.value cmd.swing_mode = self._swing_mode.value cmd.eco_mode = self._eco_mode cmd.turbo_mode = self._turbo_mode pkt_builder = packet_builder(self.id) pkt_builder.set_command(cmd) data = pkt_builder.finalize() data = self._lan_service.appliance_transparent_send(data) response = appliance_response(data) if not self._defer_update: self.update(response) finally: self._updating = False self._defer_update = False