Skip to content

Commit

Permalink
Fix ruff formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
antonverburg committed Jul 3, 2024
1 parent d295ff6 commit 53618de
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
6 changes: 4 additions & 2 deletions custom_components/pi4ioe5v9xxxx/binary_sensor.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Support for binary sensor using RPi GPIO."""

import homeassistant.helpers.config_validation as cv
import voluptuous as vol
from homeassistant.components.binary_sensor import PLATFORM_SCHEMA, BinarySensorEntity
Expand Down Expand Up @@ -32,7 +33,8 @@
)


def setup_platform( hass: HomeAssistant, # noqa: ARG001
def setup_platform(
hass: HomeAssistant, # noqa: ARG001
config: ConfigType,
add_entities: AddEntitiesCallback,
discovery_info: DiscoveryInfoType | None = None, # noqa: ARG001
Expand All @@ -52,7 +54,7 @@ def setup_platform( hass: HomeAssistant, # noqa: ARG001
binary_sensors.append(
Pi4ioe5v9BinarySensor(pin_name, pin_num, config[CONF_INVERT_LOGIC])
)
add_entities(binary_sensors, update_before_add = True)
add_entities(binary_sensors, update_before_add=True)


class Pi4ioe5v9BinarySensor(BinarySensorEntity):
Expand Down
8 changes: 5 additions & 3 deletions custom_components/pi4ioe5v9xxxx/switch.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Allows to configure a switch using RPi GPIO."""

import homeassistant.helpers.config_validation as cv
import voluptuous as vol
from homeassistant.components.switch import PLATFORM_SCHEMA, SwitchEntity
Expand Down Expand Up @@ -32,7 +33,8 @@
)


def setup_platform(hass: HomeAssistant, # noqa: ARG001
def setup_platform(
hass: HomeAssistant, # noqa: ARG001
config: ConfigType,
add_entities: AddEntitiesCallback,
discovery_info: DiscoveryInfoType | None = None, # noqa: ARG001
Expand Down Expand Up @@ -78,14 +80,14 @@ def is_on(self) -> bool:
"""Return true if device is on."""
return self._state

def turn_on(self, **kwargs: ConfigType) -> None: # noqa: ARG002
def turn_on(self, **kwargs: ConfigType) -> None: # noqa: ARG002
"""Turn the device on."""
pi4ioe5v9xxxx.pin_to_memory(self._pin, not self._invert_logic)
pi4ioe5v9xxxx.memory_to_hw()
self._state = True
self.schedule_update_ha_state()

def turn_off(self, **kwargs: ConfigType) -> None: # noqa: ARG002
def turn_off(self, **kwargs: ConfigType) -> None: # noqa: ARG002
"""Turn the device off."""
pi4ioe5v9xxxx.pin_to_memory(self._pin, self._invert_logic)
pi4ioe5v9xxxx.memory_to_hw()
Expand Down

0 comments on commit 53618de

Please sign in to comment.