Add Switcher button platform (#81245)

This commit is contained in:
Shay Levy 2022-11-28 10:06:14 +02:00 committed by GitHub
parent ec823582eb
commit f97ac9fdcd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 330 additions and 7 deletions

View file

@ -6,9 +6,11 @@ from collections.abc import Callable
import logging
from typing import Any
from aioswitcher.api.remotes import SwitcherBreezeRemoteManager
from aioswitcher.bridge import SwitcherBase, SwitcherBridge
from homeassistant.core import HomeAssistant, callback
from homeassistant.helpers import singleton
from .const import DATA_BRIDGE, DISCOVERY_TIME_SEC, DOMAIN
@ -53,3 +55,9 @@ async def async_discover_devices() -> dict[str, SwitcherBase]:
_LOGGER.debug("Finished discovery, discovered devices: %s", len(discovered_devices))
return discovered_devices
@singleton.singleton("switcher_breeze_remote_manager")
def get_breeze_remote_manager(hass: HomeAssistant) -> SwitcherBreezeRemoteManager:
"""Get Switcher Breeze remote manager."""
return SwitcherBreezeRemoteManager()