File tree Expand file tree Collapse file tree 1 file changed +12
-5
lines changed
custom_components/solaredge_modbus_multi Expand file tree Collapse file tree 1 file changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -2242,6 +2242,10 @@ class SolarEdgeBatteryAvailableEnergy(SolarEdgeSensorBase):
2242
2242
suggested_unit_of_measurement = UnitOfEnergy .KILO_WATT_HOUR
2243
2243
suggested_display_precision = 3
2244
2244
2245
+ def __init__ (self , platform , config_entry , coordinator ):
2246
+ super ().__init__ (platform , config_entry , coordinator )
2247
+ self ._log_warning = True
2248
+
2245
2249
@property
2246
2250
def unique_id (self ) -> str :
2247
2251
return f"{ self ._platform .uid_base } _avail_energy"
@@ -2263,11 +2267,14 @@ def native_value(self):
2263
2267
self ._platform .decoded_common ["B_RatedEnergy" ]
2264
2268
* self ._platform .battery_rating_adjust
2265
2269
):
2266
- _LOGGER .warning (
2267
- f"I{ self ._platform .inverter_unit_id } B{ self ._platform .battery_id } : "
2268
- "Battery available energy exceeds rated energy. "
2269
- "Set configuration for Battery Rating Adjustment when necessary."
2270
- )
2270
+ if self ._log_warning :
2271
+ _LOGGER .warning (
2272
+ f"I{ self ._platform .inverter_unit_id } B{ self ._platform .battery_id } : "
2273
+ "Battery available energy exceeds rated energy. "
2274
+ "Set configuration for Battery Rating Adjustment when necessary."
2275
+ )
2276
+ self ._log_warning = False
2277
+
2271
2278
return None
2272
2279
2273
2280
else :
You can’t perform that action at this time.
0 commit comments