mirror of
https://github.com/home-assistant/core.git
synced 2025-07-18 18:57:06 +00:00
Fix lametric sound (#10562)
* Fix sound for lametric notify * Remove not used method
This commit is contained in:
parent
637b058a7e
commit
dc6e50c39d
@ -51,13 +51,7 @@ def setup(hass, config):
|
|||||||
|
|
||||||
|
|
||||||
class HassLaMetricManager():
|
class HassLaMetricManager():
|
||||||
"""
|
"""A class that encapsulated requests to the LaMetric manager."""
|
||||||
A class that encapsulated requests to the LaMetric manager.
|
|
||||||
|
|
||||||
As the original class does not have a re-connect feature that is needed
|
|
||||||
for applications running for a long time as the OAuth tokens expire. This
|
|
||||||
class implements this reconnect() feature.
|
|
||||||
"""
|
|
||||||
|
|
||||||
def __init__(self, client_id, client_secret):
|
def __init__(self, client_id, client_secret):
|
||||||
"""Initialize HassLaMetricManager and connect to LaMetric."""
|
"""Initialize HassLaMetricManager and connect to LaMetric."""
|
||||||
@ -67,13 +61,3 @@ class HassLaMetricManager():
|
|||||||
self.manager = LaMetricManager(client_id, client_secret)
|
self.manager = LaMetricManager(client_id, client_secret)
|
||||||
self._client_id = client_id
|
self._client_id = client_id
|
||||||
self._client_secret = client_secret
|
self._client_secret = client_secret
|
||||||
|
|
||||||
def reconnect(self):
|
|
||||||
"""
|
|
||||||
Reconnect to LaMetric.
|
|
||||||
|
|
||||||
This is usually necessary when the OAuth token is expired.
|
|
||||||
"""
|
|
||||||
from lmnotify import LaMetricManager
|
|
||||||
_LOGGER.debug("Reconnecting to LaMetric")
|
|
||||||
self.manager = LaMetricManager(self._client_id, self._client_secret)
|
|
||||||
|
@ -78,12 +78,7 @@ class LaMetricNotificationService(BaseNotificationService):
|
|||||||
|
|
||||||
frames = [text_frame]
|
frames = [text_frame]
|
||||||
|
|
||||||
if sound is not None:
|
model = Model(frames=frames, sound=sound)
|
||||||
frames.append(sound)
|
|
||||||
|
|
||||||
_LOGGER.debug(frames)
|
|
||||||
|
|
||||||
model = Model(frames=frames)
|
|
||||||
lmn = self.hasslametricmanager.manager
|
lmn = self.hasslametricmanager.manager
|
||||||
try:
|
try:
|
||||||
devices = lmn.get_devices()
|
devices = lmn.get_devices()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user