Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wimb0 patch lint #108

Merged
merged 6 commits into from
Feb 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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: 2 additions & 0 deletions custom_components/saj_modbus/const.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"""Constants for SAJ R5 Inverter Modbus."""

from dataclasses import dataclass

from homeassistant.components.number import NumberEntityDescription
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)
)
)

Loading