@@ -92,7 +92,7 @@ async def async_setup_entry(
92
92
entities .append (SolarEdgeCosPhi (inverter , config_entry , coordinator ))
93
93
94
94
""" Power Control Block """
95
- if hub .option_detect_extras and inverter . advanced_power_control :
95
+ if hub .option_detect_extras :
96
96
entities .append (
97
97
SolarEdgeCommitControlSettings (inverter , config_entry , coordinator )
98
98
)
@@ -1344,12 +1344,6 @@ def extra_state_attributes(self):
1344
1344
return attrs
1345
1345
1346
1346
1347
- class SolarEdgeGlobalPowerControlBlock (SolarEdgeSensorBase ):
1348
- @property
1349
- def available (self ) -> bool :
1350
- return super ().available and self ._platform .global_power_control
1351
-
1352
-
1353
1347
class StatusVendor (SolarEdgeSensorBase ):
1354
1348
entity_category = EntityCategory .DIAGNOSTIC
1355
1349
@@ -1390,6 +1384,12 @@ def extra_state_attributes(self):
1390
1384
return None
1391
1385
1392
1386
1387
+ class SolarEdgeGlobalPowerControlBlock (SolarEdgeSensorBase ):
1388
+ @property
1389
+ def available (self ) -> bool :
1390
+ return super ().available and self ._platform .global_power_control
1391
+
1392
+
1393
1393
class SolarEdgeRRCR (SolarEdgeGlobalPowerControlBlock ):
1394
1394
@property
1395
1395
def unique_id (self ) -> str :
@@ -2336,7 +2336,13 @@ def native_value(self):
2336
2336
return self ._platform .decoded_model ["B_SOE" ]
2337
2337
2338
2338
2339
- class SolarEdgeCommitControlSettings (SolarEdgeSensorBase ):
2339
+ class SolarEdgeAdvancedPowerControlBlock (SolarEdgeSensorBase ):
2340
+ @property
2341
+ def available (self ) -> bool :
2342
+ return super ().available and self ._platform .advanced_power_control
2343
+
2344
+
2345
+ class SolarEdgeCommitControlSettings (SolarEdgeAdvancedPowerControlBlock ):
2340
2346
"""Entity to show the results of Commit Power Control Settings button."""
2341
2347
2342
2348
entity_category = EntityCategory .DIAGNOSTIC
@@ -2350,6 +2356,12 @@ def unique_id(self) -> str:
2350
2356
def name (self ) -> str :
2351
2357
return "Commit Power Settings"
2352
2358
2359
+ @property
2360
+ def available (self ) -> bool :
2361
+ return (
2362
+ super ().available and "CommitPwrCtlSettings" in self ._platform .decoded_model
2363
+ )
2364
+
2353
2365
@property
2354
2366
def native_value (self ):
2355
2367
return self ._platform .decoded_model ["CommitPwrCtlSettings" ]
@@ -2375,7 +2387,7 @@ def extra_state_attributes(self):
2375
2387
return attrs
2376
2388
2377
2389
2378
- class SolarEdgeDefaultControlSettings (SolarEdgeSensorBase ):
2390
+ class SolarEdgeDefaultControlSettings (SolarEdgeAdvancedPowerControlBlock ):
2379
2391
"""Entity to show the results of Restore Power Control Default Settings button."""
2380
2392
2381
2393
entity_category = EntityCategory .DIAGNOSTIC
@@ -2389,6 +2401,13 @@ def unique_id(self) -> str:
2389
2401
def name (self ) -> str :
2390
2402
return "Default Power Settings"
2391
2403
2404
+ @property
2405
+ def available (self ) -> bool :
2406
+ return (
2407
+ super ().available
2408
+ and "RestorePwrCtlDefaults" in self ._platform .decoded_model
2409
+ )
2410
+
2392
2411
@property
2393
2412
def native_value (self ):
2394
2413
return self ._platform .decoded_model ["RestorePwrCtlDefaults" ]
0 commit comments