Allow downloading site data as diagnostics

This commit is contained in:
2022-10-16 22:19:01 +02:00
parent 85190aa9dd
commit 1812642773
6 changed files with 34 additions and 6 deletions

View File

@@ -4,7 +4,7 @@ from datetime import timedelta
from bleak_retry_connector import close_stale_connections
from .mesh import PlejdMesh
from .api import get_cryptokey, get_devices
from .api import get_cryptokey, get_devices, get_site_data
from .plejd_device import PlejdDevice
from .const import PLEJD_SERVICE
@@ -32,6 +32,9 @@ class PlejdManager:
def connected(self):
return self.mesh is not None and self.mesh.connected
async def get_site_data(self):
return await get_site_data(**self.credentials)
async def get_devices(self):
devices = await get_devices(**self.credentials)
self.devices = {k: PlejdDevice(self, **v) for (k,v) in devices.items()}