Skip to content

Commit

Permalink
Fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
cyr-ius committed Feb 12, 2023
1 parent ede2200 commit d8b81a5
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 9 deletions.
1 change: 0 additions & 1 deletion custom_components/livebox/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
LIVEBOX_API,
LIVEBOX_ID,
PLATFORMS,
UNSUB_LISTENER,
)

CALLMISSED_SCHEMA = vol.Schema({vol.Optional(CALLID): str})
Expand Down
2 changes: 0 additions & 2 deletions custom_components/livebox/binary_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ def is_on(self):
wstatus = self.coordinator.data.get("wan_status", {}).get("data", {})
return wstatus.get("WanState") == "up"


@property
def extra_state_attributes(self):
"""Return the device state attributes."""
Expand Down Expand Up @@ -80,7 +79,6 @@ def __init__(self, coordinator, box_id):
self._attr_unique_id = f"{box_id}_callmissed"
self._attr_device_info = {"identifiers": {(DOMAIN, box_id)}}


@property
def is_on(self):
"""Return true if the binary sensor is on."""
Expand Down
2 changes: 1 addition & 1 deletion custom_components/livebox/bridge.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
UTC,
DEFAULT_TIME_ZONE,
)
from .const import CALLID, CONF_LAN_TRACKING
from .const import CALLID

_LOGGER = logging.getLogger(__name__)

Expand Down
2 changes: 1 addition & 1 deletion custom_components/livebox/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
LiveboxException,
NotOpenError,
)
from homeassistant import config_entries, core
from homeassistant import config_entries
from homeassistant.components import ssdp
from homeassistant.components.ssdp import ATTR_SSDP_UDN, ATTR_SSDP_USN
from homeassistant.const import (
Expand Down
1 change: 0 additions & 1 deletion custom_components/livebox/device_tracker.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ def __init__(self, key, bridge_id, coordinator, timeout):
self._attr_name = self._device.get("Name")
self._attr_unique_id = key


@property
def is_connected(self):
"""Return true if the device is connected to the network."""
Expand Down
2 changes: 1 addition & 1 deletion custom_components/livebox/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class FlowSensor(CoordinatorEntity, SensorEntity):

def __init__(self, coordinator, box_id, description):
"""Initialize the sensor."""
super().__init__(coordinator)
super().__init__(coordinator)
self._attributs = description.attr
self._current = description.current_rate
self.entity_description = description
Expand Down
9 changes: 7 additions & 2 deletions custom_components/livebox/switch.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ async def async_turn_off(self, **kwargs):
await self.hass.async_add_executor_job(self._api.wifi.set_wifi, parameters)
await self.coordinator.async_request_refresh()


class GuestWifiSwitch(CoordinatorEntity, SwitchEntity):
"""Representation of a livebox sensor."""

Expand All @@ -69,11 +70,15 @@ def is_on(self):
async def async_turn_on(self, **kwargs):
"""Turn the switch on."""
parameters = {"Enable": "true", "Status": "true"}
await self.hass.async_add_executor_job(self._api.guestwifi.set_guest_wifi, parameters)
await self.hass.async_add_executor_job(
self._api.guestwifi.set_guest_wifi, parameters
)
await self.coordinator.async_request_refresh()

async def async_turn_off(self, **kwargs):
"""Turn the switch off."""
parameters = {"Enable": "false", "Status": "false"}
await self.hass.async_add_executor_job(self._api.guestwifi.set_guest_wifi, parameters)
await self.hass.async_add_executor_job(
self._api.guestwifi.set_guest_wifi, parameters
)
await self.coordinator.async_request_refresh()

0 comments on commit d8b81a5

Please sign in to comment.