Skip to content

Commit

Permalink
added some await's
Browse files Browse the repository at this point in the history
  • Loading branch information
marq24 committed Jan 2, 2024
1 parent 43475a7 commit 26ba6f4
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions custom_components/senec/pysenec_ha/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1721,7 +1721,7 @@ async def switch_wallbox_allow_intercharge(self, value: bool, sync: bool = True)
if sync and IntBridge.avail():
# ALLOW_INTERCHARGE seams to be a wallbox-number independent setting... so we need to push
# this to all 4 possible wallboxes...
IntBridge.app_api.app_set_allow_intercharge_all(value_to_set=value, sync=False)
await IntBridge.app_api.app_set_allow_intercharge_all(value_to_set=value, sync=False)

async def switch(self, switch_key, value):
return await getattr(self, 'switch_' + str(switch_key))(value)
Expand Down Expand Up @@ -1896,7 +1896,7 @@ async def set_string_value_wallbox_1_mode(self, value: str):
await self.switch_array_wallbox_prohibit_usage(pos=0, value=False, sync=False)

if IntBridge.avail():
IntBridge.app_api.app_set_wallbox_mode(mode_to_set=value, wallbox_num=1, sync=False)
await IntBridge.app_api.app_set_wallbox_mode(mode_to_set=value, wallbox_num=1, sync=False)

@property
def wallbox_2_mode(self) -> str:
Expand All @@ -1911,7 +1911,7 @@ async def set_string_value_wallbox_2_mode(self, value: str):
await self.switch_array_wallbox_prohibit_usage(pos=1, value=False, sync=False)

if IntBridge.avail():
IntBridge.app_api.app_set_wallbox_mode(mode_to_set=value, wallbox_num=2, sync=False)
await IntBridge.app_api.app_set_wallbox_mode(mode_to_set=value, wallbox_num=2, sync=False)

@property
def wallbox_3_mode(self) -> str:
Expand All @@ -1926,7 +1926,7 @@ async def set_string_value_wallbox_3_mode(self, value: str):
await self.switch_array_wallbox_prohibit_usage(pos=2, value=False, sync=False)

if IntBridge.avail():
IntBridge.app_api.app_set_wallbox_mode(mode_to_set=value, wallbox_num=3, sync=False)
await IntBridge.app_api.app_set_wallbox_mode(mode_to_set=value, wallbox_num=3, sync=False)

@property
def wallbox_4_mode(self) -> str:
Expand All @@ -1941,7 +1941,7 @@ async def set_string_value_wallbox_4_mode(self, value: str):
await self.switch_array_wallbox_prohibit_usage(pos=3, value=False, sync=False)

if IntBridge.avail():
IntBridge.app_api.app_set_wallbox_mode(mode_to_set=value, wallbox_num=4, sync=False)
await IntBridge.app_api.app_set_wallbox_mode(mode_to_set=value, wallbox_num=4, sync=False)

async def set_string_value(self, key: str, value: str):
return await getattr(self, 'set_string_value_' + key)(value)
Expand Down

0 comments on commit 26ba6f4

Please sign in to comment.