platypush/platypush/plugins/light/__init__.py

29 lines
573 B
Python
Raw Permalink Normal View History

from abc import ABC
2017-11-03 20:08:17 +01:00
from platypush.plugins import action
from platypush.plugins.switch import SwitchPlugin
class LightPlugin(SwitchPlugin, ABC):
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()
# vim:sw=4:ts=4:et: