platypush/platypush/plugins/switch/__init__.py

34 lines
705 B
Python
Raw Normal View History

from platypush.plugins import Plugin, action
2017-11-04 00:13:22 +01:00
class SwitchPlugin(Plugin):
2018-06-25 19:57:43 +02:00
"""
Abstract class for interacting with switch devices
"""
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
@action
2017-11-04 00:13:22 +01:00
def on(self, args):
2018-06-25 19:57:43 +02:00
""" Turn the device on """
2017-11-04 00:13:22 +01:00
raise NotImplementedError()
@action
2017-11-04 00:13:22 +01:00
def off(self, args):
2018-06-25 19:57:43 +02:00
""" Turn the device off """
2017-11-04 00:13:22 +01:00
raise NotImplementedError()
@action
2017-11-04 00:13:22 +01:00
def toggle(self, args):
2018-06-25 19:57:43 +02:00
""" Toggle the device status (on/off) """
2017-11-04 00:13:22 +01:00
raise NotImplementedError()
@action
2017-11-04 00:13:22 +01:00
def status(self):
2018-06-25 19:57:43 +02:00
""" Get the device state """
2017-11-04 00:13:22 +01:00
raise NotImplementedError()
# vim:sw=4:ts=4:et: