mirror of
https://github.com/mjg59/python-broadlink.git
synced 2024-11-10 18:00:12 +01:00
Merge pull request #164 from horse315/master
fixed Hysen thermostat ctor & added comments
This commit is contained in:
commit
3b6b55ae73
@ -69,7 +69,7 @@ def gendevice(devtype, host, mac):
|
|||||||
elif devtype == 0x4EB5 or devtype == 0x4EF7: # MP1: 0x4eb5, honyar oem mp1: 0x4ef7
|
elif devtype == 0x4EB5 or devtype == 0x4EF7: # MP1: 0x4eb5, honyar oem mp1: 0x4ef7
|
||||||
return mp1(host=host, mac=mac, devtype=devtype)
|
return mp1(host=host, mac=mac, devtype=devtype)
|
||||||
elif devtype == 0x4EAD: # Hysen controller
|
elif devtype == 0x4EAD: # Hysen controller
|
||||||
return hysen(host=host, mac=mac)
|
return hysen(host=host, mac=mac, devtype=devtype)
|
||||||
elif devtype == 0x2722: # S1 (SmartOne Alarm Kit)
|
elif devtype == 0x2722: # S1 (SmartOne Alarm Kit)
|
||||||
return S1C(host=host, mac=mac, devtype=devtype)
|
return S1C(host=host, mac=mac, devtype=devtype)
|
||||||
elif devtype == 0x4E4D: # Dooya DT360E (DOOYA_CURTAIN_V2)
|
elif devtype == 0x4E4D: # Dooya DT360E (DOOYA_CURTAIN_V2)
|
||||||
@ -684,6 +684,15 @@ class hysen(device):
|
|||||||
# print 'Mode byte: 0x'+ format(mode_byte, '02x')
|
# print 'Mode byte: 0x'+ format(mode_byte, '02x')
|
||||||
self.send_request(bytearray([0x01,0x06,0x00,0x02,mode_byte,sensor]))
|
self.send_request(bytearray([0x01,0x06,0x00,0x02,mode_byte,sensor]))
|
||||||
|
|
||||||
|
# Advanced settings
|
||||||
|
# Sensor mode (SEN) sensor = 0 for internal sensor, 1 for external sensor, 2 for internal control temperature, external limit temperature. Factory default: 0.
|
||||||
|
# Set temperature range for external sensor (OSV) osv = 5..99. Factory default: 42C
|
||||||
|
# Deadzone for floor temprature (dIF) dif = 1..9. Factory default: 2C
|
||||||
|
# Upper temperature limit for internal sensor (SVH) svh = 5..99. Factory default: 35C
|
||||||
|
# Lower temperature limit for internal sensor (SVL) svl = 5..99. Factory default: 5C
|
||||||
|
# Actual temperature calibration (AdJ) adj = -0.5. Prescision 0.1C
|
||||||
|
# Anti-freezing function (FrE) fre = 0 for anti-freezing function shut down, 1 for anti-freezing function open. Factory default: 0
|
||||||
|
# Power on memory (POn) poweron = 0 for power on memory off, 1 for power on memory on. Factory default: 0
|
||||||
def set_advanced(self, loop_mode, sensor, osv, dif, svh, svl, adj, fre, poweron):
|
def set_advanced(self, loop_mode, sensor, osv, dif, svh, svl, adj, fre, poweron):
|
||||||
input_payload = bytearray([0x01,0x10,0x00,0x02,0x00,0x05,0x0a, loop_mode, sensor, osv, dif, svh, svl, (int(adj*2)>>8 & 0xff), (int(adj*2) & 0xff), fre, poweron])
|
input_payload = bytearray([0x01,0x10,0x00,0x02,0x00,0x05,0x0a, loop_mode, sensor, osv, dif, svh, svl, (int(adj*2)>>8 & 0xff), (int(adj*2) & 0xff), fre, poweron])
|
||||||
self.send_request(input_payload)
|
self.send_request(input_payload)
|
||||||
|
Loading…
Reference in New Issue
Block a user