Android TV Remote integration (#89935)
* Android TV Remote integration * Add diagnostics * Remove test pem files from when api was not mocked * Address review comments * Remove hass.data call in test * Store the certificate and key in /config/.storage * update comments * Update homeassistant/components/androidtv_remote/__init__.py Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io> * import callback * use async_generate_cert_if_missing --------- Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
This commit is contained in:
parent
a6c5b5e238
commit
49468ef5d0
21 changed files with 1792 additions and 0 deletions
18
homeassistant/components/androidtv_remote/helpers.py
Normal file
18
homeassistant/components/androidtv_remote/helpers.py
Normal file
|
@ -0,0 +1,18 @@
|
|||
"""Helper functions for Android TV Remote integration."""
|
||||
from __future__ import annotations
|
||||
|
||||
from androidtvremote2 import AndroidTVRemote
|
||||
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.helpers.storage import STORAGE_DIR
|
||||
|
||||
|
||||
def create_api(hass: HomeAssistant, host: str) -> AndroidTVRemote:
|
||||
"""Create an AndroidTVRemote instance."""
|
||||
return AndroidTVRemote(
|
||||
client_name="Home Assistant",
|
||||
certfile=hass.config.path(STORAGE_DIR, "androidtv_remote_cert.pem"),
|
||||
keyfile=hass.config.path(STORAGE_DIR, "androidtv_remote_key.pem"),
|
||||
host=host,
|
||||
loop=hass.loop,
|
||||
)
|
Loading…
Add table
Add a link
Reference in a new issue