diff --git a/doc/classes.txt b/doc/classes.txt index fa7a1a3..a0a190c 100644 --- a/doc/classes.txt +++ b/doc/classes.txt @@ -11,7 +11,7 @@ -------------------------------------------------------------------------------- REQUIREMENTS -1. To be able to write expressive and compact applications, +1. EXPRESSIVE: To be able to write expressive and compact applications, that talk in the vocabulary of physical devices. a. All known Energenie devices to be modelled as classes inside a @@ -32,7 +32,7 @@ than the implementation details. -2. To be able to build a local registry of devices and their configurations, +2. NAME REGISTRY: To be able to build a local registry of devices and their configurations, and refer to devices by name inside the application. a. to be configurable by learning (e.g. listen for messages such as @@ -53,7 +53,7 @@ type x' or 'find me all devices in location kitchen'. -3. To be able to command and query devices in a way that represents +3. INTENTS: To be able to command and query devices in a way that represents meaningful device-based intents (such as tv.on() and tv.get_power()) a. received data values to be cached for deferred query, such as get_power() @@ -66,13 +66,13 @@ both by commanded state and retrieved state) -4. To be able to refer to user devices in an Energenie device agnostic way. +4. AGNOSTIC: To be able to refer to user devices in an Energenie device agnostic way. e.g. it doesn't matter if the TV is plugged into a green button device, or a MiHome device. It is always tv.on() in the code. -5. To be able to instigate and manage learn mode from within an app +5. LEARN/DISCOVER: To be able to instigate and manage learn mode from within an app a. To send specific commands to green button devices so they can learn the pattern @@ -83,7 +83,7 @@ c. To process MiHome join requests, and send MiHome join acks -6. To completely hide the user from the on-air radio interface +6. ABSTRACTED RADIO: To completely hide the user from the on-air radio interface a. choosing the correct radio frequency and modulation automatically @@ -94,7 +94,7 @@ Not as part of this work, but this should at least be enabled by the design -7. To be able to build a well performing system +7. PERFORMING: To be able to build a well performing system with very few message collisions and message losses a. by dynamically learning report patterns of MiHome devices diff --git a/src/energenie/Devices.py b/src/energenie/Devices.py index f2275bb..0c604e5 100644 --- a/src/energenie/Devices.py +++ b/src/energenie/Devices.py @@ -89,4 +89,85 @@ return False +#----- NEW DEVICE CLASSES ----------------------------------------------------- + +class Device(): + pass + # get_manufacturer_id + # get_product_id + # get_sensor_id + + # get_last_receive_time + # get_last_send_time + # get_next_receive_time + # get_next_send_time + + # incoming_message (OOK or OpenThings as appropriate, stripped of header? decrypted, decoded to pydict) + # send_message (a link out to the transport, could be mocked, for example) + + +class EnergenieDevice(Device): + pass + # get_radio_config -> config_selector? (freq, modulation) config_parameters? (inner_repeats, delay, outer_repeats) + # has_switch + # can_send + # can_receive + + +class LegacyDevice(EnergenieDevice): + pass + # modulation = OOK + # freq = 433.92MHz + # codec = 4bit + + +class ENER002(LegacyDevice): + pass + # turn_on + # turn_off + + +class MiHomeDevice(EnergenieDevice): + pass + # modulation = FSK + # freq = 433.92MHz + # codec = OpenThings + + +class MIHO005(MiHomeDevice): # Adaptor Plus + pass + # tx_repeats = 4 + # turn_on + # turn_off + # is_on + # is_off + # get_switch + # get_voltage + # get_frequency + # get_apparent + # get_reactive + # get_real + + +class MIHO006(MiHomeDevice): # Home Monitor + pass + # get_battery_voltage + # get_current + + +class MIHO012(MiHomeDevice): # eTRV + pass + # tx_repeats = 10 + # get_battery_voltage + # get_ambient_temperature + # get_pipe_temperature + # get_setpoint_temperature + # set_setpoint_temperature + # get_valve_position + # set_valve_position + # turn_on + # turn_off + # is_on + # is_off + # END