Update switch.py

This commit is contained in:
zhujisheng 2019-05-20 18:26:16 +08:00
parent c83ffc7005
commit 8c5e123601
1 changed files with 0 additions and 11 deletions

View File

@ -53,17 +53,6 @@ class my_switch(SwitchDevice):
self._is_on = False
self._name = 'my_relay_' + str(bytes([address,coil]))
def _control(self, turn_on, transition=0):
if turn_on:
turn_on_id = b'\x01'
else:
turn_on_id = b'\x00'
transition_id = bytes([transition])
command = b'\xaa\x55\x06\xb3'
command += (self._zone_id + self._device_id + self._channel_id + turn_on_id + transition_id)
self._bus.write(command)
@property
def is_on(self):
"""Return true if device is on."""