Home Assistant Unofficial Reference
2024.12.1
subscriber.py
Go to the documentation of this file.
1
"""Subscriber for devolo home control API publisher."""
2
3
from
collections.abc
import
Callable
4
import
logging
5
6
_LOGGER = logging.getLogger(__name__)
7
8
9
class
Subscriber
:
10
"""Subscriber class for the publisher in mprm websocket class."""
11
12
def
__init__
(self, name: str, callback: Callable) ->
None
:
13
"""Initiate the subscriber."""
14
self.
name
name = name
15
self.
callback
callback = callback
16
17
def
update
(self, message: str) ->
None
:
18
"""Trigger hass to update the device."""
19
_LOGGER.debug(
'%s got message "%s"'
, self.
name
name, message)
20
self.
callback
callback(message)
homeassistant.components.devolo_home_control.subscriber.Subscriber
Definition:
subscriber.py:9
homeassistant.components.devolo_home_control.subscriber.Subscriber.update
None update(self, str message)
Definition:
subscriber.py:17
homeassistant.components.devolo_home_control.subscriber.Subscriber.callback
callback
Definition:
subscriber.py:15
homeassistant.components.devolo_home_control.subscriber.Subscriber.__init__
None __init__(self, str name, Callable callback)
Definition:
subscriber.py:12
homeassistant.components.devolo_home_control.subscriber.Subscriber.name
name
Definition:
subscriber.py:14
core
homeassistant
components
devolo_home_control
subscriber.py
Generated by
1.9.1