diff --git a/doc/branch_ook_radio_config.txt b/doc/branch_ook_radio_config.txt index 1a1de09..5e09293 100644 --- a/doc/branch_ook_radio_config.txt +++ b/doc/branch_ook_radio_config.txt @@ -30,11 +30,17 @@ DONE 6. Need to use the TxDefaults() structure to get good reuse across the class hierarchy +DONE 7 Add MIHO014 3kw relay (It's just a legacy device, so only needs a wrapper class) + + All tested in simulation and works. Just need to test on real devices, before merge back to master. + + + FUTURE WORK Not part of this change, but we should note somewhere that this will need diff --git a/src/energenie/Devices.py b/src/energenie/Devices.py index 69a59e1..528145a 100644 --- a/src/energenie/Devices.py +++ b/src/energenie/Devices.py @@ -34,7 +34,7 @@ ##PRODUCTID_MIHO011 not used ##PRODUCTID_MIHO012 not used PRODUCTID_MIHO013 = 0x03 # eTRV -##PRODUCTID_MIHO014 = 0x0? # In-line Relay +##PRODUCTID_MIHO014 # OOK In-line Relay ##PRODUCTID_MIHO015 not used ##PRODUCTID_MIHO016 not used ##PRODUCTID_MIHO017 @@ -490,8 +490,8 @@ #------------------------------------------------------------------------------ -class ENER002(LegacyDevice): - """A green-button switch""" +class OOKSwitch(LegacyDevice): + """Any OOK controlled switch""" def __init__(self, device_id, air_interface=None): LegacyDevice.__init__(self, device_id, air_interface) self.radio_config.inner_times = 8 @@ -499,7 +499,7 @@ self.capabilities.receive = True def __repr__(self): - return "ENER002(%s,%s)" % (str(hex(self.device_id[0])), str(hex(self.device_id[1]))) + return "OOKSwitch(%s,%s)" % (str(hex(self.device_id[0])), str(hex(self.device_id[1]))) def turn_on(self): @@ -531,6 +531,18 @@ self.turn_off() +class ENER002(OOKSwitch): + """A green button switch""" + def __repr__(self): + return "ENER002(%s,%s)" % (str(hex(self.device_id[0])), str(hex(self.device_id[1]))) + + +class MIHO014(OOKSwitch): + """Energenie 3kW switchable relay""" + def __repr__(self): + return "MIHO014(%s,%s)" % (str(hex(self.device_id[0])), str(hex(self.device_id[1]))) + + #------------------------------------------------------------------------------ class MiHomeLight(LegacyDevice): @@ -925,6 +937,7 @@ "MIHO006": MIHO006, "HomeMonitor": MIHO006, "MIHO008": MIHO008, "MiHomeLightWhite": MIHO008, # OOK "MIHO013": MIHO013, "eTRV": MIHO013, + "MIHO014": MIHO014, "3kWRelay": MIHO014, # OOK "MIHO024": MIHO024, "MiHomeLightBlack": MIHO024, # OOK "MIHO025": MIHO025, "MiHomeLightChrome": MIHO025, # OOK "MIHO026": MIHO026, "MiHomeLightSteel": MIHO026, # OOK @@ -941,6 +954,7 @@ PRODUCTID_MIHO005: MIHO005, PRODUCTID_MIHO006: MIHO006, PRODUCTID_MIHO013: MIHO013, + #MIHO014 is an OOK #MIHO024 is an OOK #MIHO025 is an OOK #MIHO026 is an OOK diff --git a/src/registry.kvs b/src/registry.kvs index d8473ec..481bfb6 100644 --- a/src/registry.kvs +++ b/src/registry.kvs @@ -14,7 +14,24 @@ type=MIHO032 device_id=4042 -ADD white_light +ADD light_white type=MIHO008 +device_id=[0x6C6C6, 1] + +ADD light_black +type=MIHO024 device_id=[0x6C6C6, 2] +ADD light_chrome +type=MIHO025 +device_id=[0x6C6C6, 3] + +ADD light_steel +type=MIHO026 +device_id=[0x6C6C6, 4] + +ADD relay +type=MIHO014 +device_id=[0x6C6C6, 1] + +