DPT Switch
OnOff
- class knx_plugin.command.dpt_switch.OnOff(data: dict)
>>> import home >>> import knx_plugin >>> old_state = home.appliance.light.indoor.hue.state.off.State() >>> new_state = old_state.next(home.appliance.light.indoor.dimmerable.event.forced.Event.On) >>> command = knx_plugin.command.dpt_switch.OnOff.make([0xAAAA]) >>> command._asaps = [1] >>> command.make_msgs_from(old_state, new_state) [GroupValueWriteReq (DPT_Switch {'action': 'on'} for asap 1)]
- DPT = {'addresses': [], 'fields': {'action': 'off'}, 'name': 'DPT_Switch', 'type': 'knx'}
- make_msgs_from(old_state: knx_plugin.command.OnOffAppliance, new_state: knx_plugin.command.OnOffAppliance)
If Appliance has been turned on then send a dpt_switch on message on bus
If Appliance has been turned off then send a dpt_switch off message on bus
OffOn
- class knx_plugin.command.dpt_switch.OffOn(data: dict)
- DPT = {'addresses': [], 'fields': {'action': 'off'}, 'name': 'DPT_Switch', 'type': 'knx'}
- make_msgs_from(old_state: knx_plugin.command.OnOffAppliance, new_state: knx_plugin.command.OnOffAppliance)
If Appliance has been turned on then send a dpt_switch off message on bus
If Appliance has been turned off then send a dpt_switch on message on bus