updated stats

This commit is contained in:
2025-02-07 23:09:11 -05:00
parent 5d5aea3cf4
commit 37022b132f

6
app.py
View File

@ -63,13 +63,11 @@ class UnifiAPI:
return sites[0]['_id']
def get_all_devices(self):
url = f"{self.base_url}/integration/v1/sites/{self.site_id}/devices"
url = f"{self.base_url}/proxy/network/api/s/{self.site_id}/stat/device"
response = self.session.get(url, headers=self.headers)
response.raise_for_status()
logger.debug(f"Raw response content: {response.content}")
logger.debug(f"Response headers: {dict(response.headers)}")
logger.debug(f"Response encoding: {response.encoding}")
return response.json()['data']
def get_device_details(self, device_id):
url = f"{self.base_url}/proxy/network/integration/v1/sites/{self.site_id}/devices/{device_id}"
response = self.session.get(url, headers=self.headers)