Skip to content

Commit

Permalink
Add wps, wifi and wan ip informations
Browse files Browse the repository at this point in the history
  • Loading branch information
cyr-ius committed Dec 14, 2024
1 parent aed55a5 commit 4dbec46
Showing 1 changed file with 7 additions and 15 deletions.
22 changes: 7 additions & 15 deletions custom_components/bbox/coordinator.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@

from __future__ import annotations

from datetime import timedelta
import logging
from datetime import timedelta
from typing import Any

from bboxpy import AuthorizationError, Bbox

from homeassistant.config_entries import ConfigEntry
from homeassistant.const import CONF_HOST, CONF_PASSWORD, CONF_VERIFY_SSL
from homeassistant.core import HomeAssistant
Expand Down Expand Up @@ -68,18 +67,13 @@ async def _async_update_data(self) -> dict[str, dict[str, Any]]:
try:
bbox_info = self.check_list(await self.bbox.device.async_get_bbox_info())
devices = await self.bbox.lan.async_get_connected_devices()
assert isinstance(
devices, list
), f"Failed to retrieved devices from Bbox API: {devices}"
wan_ip_stats = self.check_list(await self.bbox.wan.async_get_wan_ip_stats())
parentalcontrol = self.check_list(
await self.bbox.parentalcontrol.async_get_parental_control_service_state()
)
# wan = self.check_list(await self.bbox.wan.async_get_wan_ip())
# iptv_channels_infos = self.check_list(await self.bbox.iptv.async_get_iptv_info())
# lan_stats = self.check_list(await self.bbox.lan.async_get_lan_stats())
# voicemail = self.check_list(await self.bbox.voip.async_get_voip_voicemail())
# device_info = self.check_list(await self.bbox.lan.async_get_device_infos())
wps = self.check_list(await self.bbox.async_get_wps())
wifi = self.check_list(await self.bbox.async_get_wireless())
wan_ip = self.check_list(await self.bbox.async_get_wan_ip())
except Exception as error:
_LOGGER.error(error)
raise UpdateFailed from error
Expand All @@ -89,11 +83,9 @@ async def _async_update_data(self) -> dict[str, dict[str, Any]]:
"devices": self.merge_objects(devices),
"wan_ip_stats": wan_ip_stats,
"parentalcontrol": parentalcontrol,
# "wan": wan,
# "iptv_channels_infos": iptv_channels_infos,
# "lan_stats": lan_stats,
# "voicemail": voicemail,
# "device_info": device_info,
"wps": wps,
"wifi": wifi,
"wan_ip": wan_ip,
}

@staticmethod
Expand Down

0 comments on commit 4dbec46

Please sign in to comment.