@@ -28,19 +28,22 @@ async def async_setup_entry(
2828 client = hass .data [DOMAIN ][DATA_CLIENT ]
2929
3030 switches = [OhmePauseChargeSwitch (coordinator , hass , client ),
31- OhmeMaxChargeSwitch (coordinator , hass , client )]
32-
31+ OhmeMaxChargeSwitch (coordinator , hass , client )]
32+
3333 if client .is_capable ("buttonsLockable" ):
3434 switches .append (
35- OhmeConfigurationSwitch (accountinfo_coordinator , hass , client , "Lock Buttons" , "lock" , "buttonsLocked" )
35+ OhmeConfigurationSwitch (
36+ accountinfo_coordinator , hass , client , "Lock Buttons" , "lock" , "buttonsLocked" )
3637 )
3738 if client .is_capable ("pluginsRequireApprovalMode" ):
3839 switches .append (
39- OhmeConfigurationSwitch (accountinfo_coordinator , hass , client , "Require Approval" , "check-decagram" , "pluginsRequireApproval" )
40+ OhmeConfigurationSwitch (accountinfo_coordinator , hass , client ,
41+ "Require Approval" , "check-decagram" , "pluginsRequireApproval" )
4042 )
4143 if client .is_capable ("stealth" ):
4244 switches .append (
43- OhmeConfigurationSwitch (accountinfo_coordinator , hass , client , "Sleep When Inactive" , "power-sleep" , "stealthEnabled" )
45+ OhmeConfigurationSwitch (accountinfo_coordinator , hass , client ,
46+ "Sleep When Inactive" , "power-sleep" , "stealthEnabled" )
4447 )
4548
4649 async_add_entities (switches , update_before_add = True )
@@ -206,14 +209,14 @@ def _handle_coordinator_update(self) -> None:
206209
207210 async def async_turn_on (self ):
208211 """Turn on the switch."""
209- await self ._client .async_set_configuration_value ({ self ._config_key : True })
212+ await self ._client .async_set_configuration_value ({self ._config_key : True })
210213
211214 await asyncio .sleep (1 )
212215 await self .coordinator .async_refresh ()
213216
214217 async def async_turn_off (self ):
215218 """Turn off the switch."""
216- await self ._client .async_set_configuration_value ({ self ._config_key : False })
219+ await self ._client .async_set_configuration_value ({self ._config_key : False })
217220
218221 await asyncio .sleep (1 )
219222 await self .coordinator .async_refresh ()
0 commit comments