Esempio n. 1
0
    def off(self):
        """Send the Off command to an X10 device."""
        msg = X10Send.unit_code_msg(self.address.x10_housecode,
                                    self.address.x10_unitcode)
        self._send_method(msg)

        msg = X10Send.command_msg(self.address.x10_housecode, X10_COMMAND_OFF)
        self._send_method(msg, False)
        self._update_subscribers(0x00)
Esempio n. 2
0
    def dim(self, defer_update=False):
        """Dim the device one step."""
        msg = X10Send.unit_code_msg(self.address.x10_housecode,
                                    self.address.x10_unitcode)
        self._send_method(msg)

        msg = X10Send.command_msg(self.address.x10_housecode, X10_COMMAND_DIM)
        self._send_method(msg, False)
        if not defer_update:
            self._update_subscribers(self._value - 255 / self._steps)
Esempio n. 3
0
    def brighten(self, defer_update=False):
        """Brighten the device one step."""
        msg = X10Send.unit_code_msg(self.address.x10_housecode,
                                    self.address.x10_unitcode)
        self._send_method(msg)

        msg = X10Send.command_msg(self.address.x10_housecode,
                                  X10_COMMAND_BRIGHT)
        self._send_method(msg, False)
        if not defer_update:
            self._update_subscribers(self._value + 255 / self._steps)