From 085ea4be771a698976eb338ab655d6df8baeb098 Mon Sep 17 00:00:00 2001 From: Wim <11030068+wimb0@users.noreply.github.com> Date: Tue, 11 Feb 2025 11:56:23 +0100 Subject: [PATCH 1/6] Update config_flow.py --- custom_components/saj_modbus/config_flow.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/custom_components/saj_modbus/config_flow.py b/custom_components/saj_modbus/config_flow.py index 1c1b9b2..ef0ffb1 100644 --- a/custom_components/saj_modbus/config_flow.py +++ b/custom_components/saj_modbus/config_flow.py @@ -1,3 +1,5 @@ +"""Config flow for SAJ R5 Inverter Modbus.""" + import ipaddress import re From 2f9840e6df27bf77c61391352f344cd3111498e3 Mon Sep 17 00:00:00 2001 From: Wim <11030068+wimb0@users.noreply.github.com> Date: Tue, 11 Feb 2025 12:36:23 +0100 Subject: [PATCH 2/6] Update const.py --- custom_components/saj_modbus/const.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/custom_components/saj_modbus/const.py b/custom_components/saj_modbus/const.py index 2df5a5b..10931b4 100644 --- a/custom_components/saj_modbus/const.py +++ b/custom_components/saj_modbus/const.py @@ -1,3 +1,5 @@ +"""Constants for SAJ R5 Inverter Modbus.""" + from dataclasses import dataclass from homeassistant.components.number import NumberEntityDescription From d4bba43464f16aac39467818e152e24ec7740bbc Mon Sep 17 00:00:00 2001 From: Wim <11030068+wimb0@users.noreply.github.com> Date: Tue, 11 Feb 2025 12:37:50 +0100 Subject: [PATCH 3/6] Update hub.py --- custom_components/saj_modbus/hub.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/custom_components/saj_modbus/hub.py b/custom_components/saj_modbus/hub.py index 62b4c7e..64cfe47 100644 --- a/custom_components/saj_modbus/hub.py +++ b/custom_components/saj_modbus/hub.py @@ -1,4 +1,4 @@ -"""SAJ Modbus Hub""" +"""SAJ Modbus Hub.""" from homeassistant.helpers.update_coordinator import DataUpdateCoordinator from voluptuous.validators import Number import logging From 5e31a3237a1f8aa2a10f32e405f74f3bc188c013 Mon Sep 17 00:00:00 2001 From: Wim <11030068+wimb0@users.noreply.github.com> Date: Tue, 11 Feb 2025 12:38:48 +0100 Subject: [PATCH 4/6] Update sensor.py --- custom_components/saj_modbus/sensor.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/custom_components/saj_modbus/sensor.py b/custom_components/saj_modbus/sensor.py index 8622230..a2e59ef 100644 --- a/custom_components/saj_modbus/sensor.py +++ b/custom_components/saj_modbus/sensor.py @@ -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 @@ -98,4 +100,4 @@ 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 \ No newline at end of file + return None From de732cefc0fd6f5efa8139afc4660d9eac1771cb Mon Sep 17 00:00:00 2001 From: Wim <11030068+wimb0@users.noreply.github.com> Date: Tue, 11 Feb 2025 12:42:02 +0100 Subject: [PATCH 5/6] Update sensor.py --- custom_components/saj_modbus/sensor.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/custom_components/saj_modbus/sensor.py b/custom_components/saj_modbus/sensor.py index a2e59ef..1a559cb 100644 --- a/custom_components/saj_modbus/sensor.py +++ b/custom_components/saj_modbus/sensor.py @@ -101,3 +101,5 @@ def native_value(self): if self.coordinator.data.get("mpvmode") in (1, 2): # "Waiting" or "Normal" return self.coordinator.data.get(self.entity_description.key) return None + + From 25f44b3f4138f96f80a8657a5e49b0d6435a58ec Mon Sep 17 00:00:00 2001 From: Wim <11030068+wimb0@users.noreply.github.com> Date: Tue, 11 Feb 2025 12:42:16 +0100 Subject: [PATCH 6/6] Update services.py --- custom_components/saj_modbus/services.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/custom_components/saj_modbus/services.py b/custom_components/saj_modbus/services.py index 09bd748..1f16e39 100644 --- a/custom_components/saj_modbus/services.py +++ b/custom_components/saj_modbus/services.py @@ -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) - ) \ No newline at end of file + ) +