Source code for platypush.message.event.google
from platypush.message.event import Event
[docs]
class GoogleDeviceEvent(Event):
"""
Base class for Google device events, see `managing traits and handlers <https://developers.google.com/assistant/sdk/guides/service/python/extend/add-trait-and-handler>`_.
"""
[docs]
def __init__(self, device_id, device_model_id=None, *args, **kwargs):
super().__init__(*args, device_id=device_id, device_model_id=device_model_id, **kwargs)
[docs]
class GoogleDeviceOnOffEvent(GoogleDeviceEvent):
"""
Event triggered when a device receives an on/off command
"""
[docs]
def __init__(self, on, *args, **kwargs):
super().__init__(*args, **kwargs)
self.on = on
# vim:sw=4:ts=4:et: