Skip to content

Commit

Permalink
Ruff checks
Browse files Browse the repository at this point in the history
  • Loading branch information
flip555 committed Sep 19, 2023
1 parent 08af3a9 commit 64a36be
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 11 deletions.
2 changes: 2 additions & 0 deletions .ruff.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ select = [
]

ignore = [
"C901",
"D100", # Missing docstring in public module
"D100", # Missing docstring in public module
"D101", # Missing docstring in public class
"D102", # Missing docstring in public method
Expand Down
4 changes: 0 additions & 4 deletions custom_components/bms_connector/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,10 @@
PLATFORMS = ["sensor"]

async def async_setup(hass, config):
"""Set up the BMS Connector integration."""
hass.data[DOMAIN] = {}
return True

async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
"""Set up a BMS Connector entry."""
hass.data.setdefault(DOMAIN, {})
hass.data[DOMAIN][entry.entry_id] = entry.data # You can store entry data if needed

Expand All @@ -28,12 +26,10 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
return True

async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
"""Unload a BMS Connector entry."""
if unloaded := await hass.config_entries.async_unload_platforms(entry, PLATFORMS):
hass.data[DOMAIN].pop(entry.entry_id)
return unloaded

async def async_reload_entry(hass: HomeAssistant, entry: ConfigEntry) -> None:
"""Reload a BMS Connector entry."""
await async_unload_entry(hass, entry)
await async_setup_entry(hass, entry)
1 change: 0 additions & 1 deletion custom_components/bms_connector/bms/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
"""Holding File."""
1 change: 0 additions & 1 deletion custom_components/bms_connector/bms/seplos/v2/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
"""Holding File."""
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
class Alarms:
"""Represents an object to store alarm information."""

def __init__(self):
"""Initialize an empty Alarms object with default values."""
self.cellsCount = 0
self.cellAlarm = []
self.tempCount = 0
Expand All @@ -26,7 +23,6 @@ def __init__(self):
self.alarmEvent7 = 0

def __str__(self):
"""Return a string representation of the Alarms object."""
return (
f"cellsCount: {self.cellsCount}, "
f"cellAlarm: {self.cellAlarm}, "
Expand All @@ -52,7 +48,6 @@ def __str__(self):
)

def parse_teledata_info(info_str):
"""Parse a string containing teledata information and return an Alarms object."""
result = Alarms()
cursor = 4

Expand Down

0 comments on commit 64a36be

Please sign in to comment.