Skip to content

Commit

Permalink
Merge pull request #108 from wimb0/wimb0-patch-lint
Browse files Browse the repository at this point in the history
Wimb0 patch lint
  • Loading branch information
wimb0 authored Feb 11, 2025
2 parents 28927ea + 25f44b3 commit 263dbe7
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
2 changes: 2 additions & 0 deletions custom_components/saj_modbus/config_flow.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"""Config flow for SAJ R5 Inverter Modbus."""

import ipaddress
import re

Expand Down
2 changes: 1 addition & 1 deletion custom_components/saj_modbus/hub.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""SAJ Modbus Hub"""
"""SAJ Modbus Hub."""
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator
from voluptuous.validators import Number
import logging
Expand Down
6 changes: 5 additions & 1 deletion custom_components/saj_modbus/sensor.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"""Sensor Platform Device for SAJ R5 Inverter Modbus."""

from __future__ import annotations
from datetime import datetime
from homeassistant.helpers.update_coordinator import CoordinatorEntity
Expand Down Expand Up @@ -98,4 +100,6 @@ def native_value(self):
# the values returned by the inverter are not reliable.
if self.coordinator.data.get("mpvmode") in (1, 2): # "Waiting" or "Normal"
return self.coordinator.data.get(self.entity_description.key)
return None
return None


3 changes: 2 additions & 1 deletion custom_components/saj_modbus/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,5 @@ async def async_set_date_time(hass: HomeAssistant, data: Mapping[str, Any]) -> N
await hass.async_add_executor_job(
hub.set_date_and_time,
data.get(ATTR_DATETIME, None)
)
)

0 comments on commit 263dbe7

Please sign in to comment.