File tree Expand file tree Collapse file tree
custom_components/enpal_webparser Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1717# See README.md for setup and usage instructions.
1818#
1919
20+ import asyncio
2021from functools import cached_property
2122import logging
2223
@@ -91,6 +92,9 @@ async def async_press(self):
9192 except Exception as e :
9293 _LOGGER .exception ("[Enpal] Wallbox request failed: %s" , e )
9394
95+ # Wait a moment to allow the wallbox to process the change
96+ await asyncio .sleep (2 )
97+
9498 await self ._hass .services .async_call (
9599 "homeassistant" ,
96100 "update_entity" ,
Original file line number Diff line number Diff line change 2222# --- Default Connection Settings ---
2323DEFAULT_URL = "http://192.168.178.178/deviceMessages"
2424DEFAULT_INTERVAL = 60
25+
2526DEFAULT_GROUPS = [
2627 "Wallbox" ,
2728 "Battery" ,
3031 "IoTEdgeDevice" ,
3132 "PowerSensor" ,
3233]
34+
3335DEFAULT_USE_WALLBOX_ADDON = False
3436DEFAULT_WALLBOX_API_ENDPOINT = "http://localhost:36725/wallbox"
3537
6264 "energy_battery_charge_level_absolute" : "battery" ,
6365}
6466
67+ STATE_CLASS_OVERRIDES = {
68+ "energy_battery_charge_level" : "measurement" ,
69+ "energy_battery_charge_level_unit_1" : "measurement" ,
70+ "energy_battery_charge_level_unit_2" : "measurement" ,
71+ "energy_battery_charge_level_absolute" : "measurement" ,
72+ }
73+
6574# --- Wallbox Mode Mapping ---
6675WALLBOX_MODE_MAP = {
6776 "eco" : "Eco" ,
7281# --- Date/Time Formats ---
7382ENPAL_TIMESTAMP_FORMAT = "%m/%d/%Y %H:%M:%S"
7483
75-
7684ICON_MAP = {
7785 # IoT Edge Device
7886 "iotedgedevice_cpu_load" : "mdi:cpu-64-bit" ,
216224 "voltage_wallbox_connector_1_phase_c" : "mdi:transmission-tower" ,
217225}
218226
219- STATE_CLASS_OVERRIDES = {
220- "energy_battery_charge_level" : "measurement" ,
221- "energy_battery_charge_level_unit_1" : "measurement" ,
222- "energy_battery_charge_level_unit_2" : "measurement" ,
223- "energy_battery_charge_level_absolute" : "measurement" ,
224- }
Original file line number Diff line number Diff line change 1717# See README.md for setup and usage instructions.
1818#
1919
20+ import asyncio
2021import logging
2122from functools import cached_property
2223
@@ -99,6 +100,9 @@ async def async_select_option(self, option: str):
99100
100101 await self ._call_wallbox_api (f"/set_{ key } " )
101102
103+ # Wait a moment to allow the wallbox to process the change
104+ await asyncio .sleep (2 )
105+
102106 await self ._hass .services .async_call (
103107 "homeassistant" ,
104108 "update_entity" ,
Original file line number Diff line number Diff line change @@ -118,10 +118,10 @@ async def _call_wallbox_api(self, endpoint):
118118 else :
119119 _LOGGER .debug ("Wallbox API call success: %s" , url )
120120
121- # Kurze Verzögerung für Übernahme des Status
121+ # Short wait to allow wallbox to process the change
122122 await asyncio .sleep (2 )
123123
124- # Sensoren aktiv aktualisieren
124+ # Get new status after command
125125 await self ._hass .services .async_call (
126126 "homeassistant" , "update_entity" ,
127127 {
You can’t perform that action at this time.
0 commit comments