platypush/platypush/plugins/light/__init__.py

31 lines
624 B
Python
Raw Normal View History

from platypush.plugins import Plugin, action
2017-11-03 20:08:17 +01:00
2017-11-03 20:08:17 +01:00
class LightPlugin(Plugin):
2018-06-25 00:49:45 +02:00
"""
Abstract plugin to interface your logic with lights/bulbs.
"""
@action
2017-11-03 20:08:17 +01:00
def on(self):
2018-06-25 00:49:45 +02:00
""" Turn the light on """
2017-11-03 20:08:17 +01:00
raise NotImplementedError()
@action
2017-11-03 20:08:17 +01:00
def off(self):
2018-06-25 00:49:45 +02:00
""" Turn the light off """
2017-11-03 20:08:17 +01:00
raise NotImplementedError()
@action
2017-11-03 20:08:17 +01:00
def toggle(self):
2018-06-25 00:49:45 +02:00
""" Toggle the light status (on/off) """
2017-11-03 20:08:17 +01:00
raise NotImplementedError()
@action
def status(self, *args, **kwargs):
2018-06-25 00:49:45 +02:00
""" Get the light status """
2017-11-03 20:08:17 +01:00
raise NotImplementedError()
# vim:sw=4:ts=4:et: