Skip to content

Commit

Permalink
Merge pull request egnerfl#12 from leeyuentuen/more_info_2
Browse files Browse the repository at this point in the history
add ocpp category data, enable/disable socket1, enable/disable network (ethernet and gprs)
  • Loading branch information
leeyuentuen authored Jul 6, 2023
2 parents 88f63e0 + d4248e9 commit 62918b9
Show file tree
Hide file tree
Showing 4 changed files with 84 additions and 1 deletion.
2 changes: 1 addition & 1 deletion custom_components/alfen_wallbox/alfen.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ async def _do_update(self):
await self.login()

properties = []
for i in ("generic", "generic2", "meter1", "states", "temp"):
for i in ("generic", "generic2", "meter1", "states", "temp", "ocpp"):
nextRequest = True
offset = 0
while (nextRequest):
Expand Down
6 changes: 6 additions & 0 deletions custom_components/alfen_wallbox/binary_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ class AlfenBinaryDescription(BinarySensorEntityDescription, AlfenBinaryDescripti
device_class=None,
api_param="205B_0",
),
AlfenBinaryDescription(
key="lb_enable_max_imbalance_current",
name="LB Enable Max Imbalance Current",
device_class=None,
api_param="2174_1",
),
)


Expand Down
14 changes: 14 additions & 0 deletions custom_components/alfen_wallbox/number.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,20 @@ class AlfenNumberDescription(NumberEntityDescription, AlfenNumberDescriptionMixi
unit_of_measurement=UnitOfPower.WATT,
api_param="2061_2",
),
AlfenNumberDescription(
key="lb_max_imbalance_current",
name="Max. Imbalance Current between phases",
state=None,
icon="mdi:current-ac",
assumed_state=False,
device_class=NumberDeviceClass.POWER_FACTOR,
native_min_value=0,
native_max_value=10,
native_step=1,
mode=NumberMode.SLIDER,
unit_of_measurement=UnitOfElectricCurrent.AMPERE,
api_param="2174_0",
),
)


Expand Down
63 changes: 63 additions & 0 deletions custom_components/alfen_wallbox/select.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,24 @@ class AlfenSelectDescription(SelectEntityDescription, AlfenSelectDescriptionMixi
"Swedish": "sv_SE",
}

ALLOWED_PHASE_DICT: Final[dict[str, int]] = {
"1 Phase": 1,
"3 Phases": 3,
}

PRIORITIES_DICT: Final[dict[str, int]] = {
"Disable": 0,
"1": 1,
"2": 2,
"3": 3,
"4": 4
}

OPERATIVE_MODE_DICT: Final[dict[str, int]] = {
"Operative": 0,
"In-operative": 2,
}

ALFEN_SELECT_TYPES: Final[tuple[AlfenSelectDescription, ...]] = (
AlfenSelectDescription(
key="lb_solar_charging_mode",
Expand Down Expand Up @@ -163,6 +181,51 @@ class AlfenSelectDescription(SelectEntityDescription, AlfenSelectDescriptionMixi
options_dict=DISPLAY_LANGUAGE_DICT,
api_param="205D_0",
),
AlfenSelectDescription(
key="lb_max_allowed_phase_socket_1",
name="Load Balancing Max Allowed of Phases Socket 1",
icon="mdi:scale-balance",
options=list(ALLOWED_PHASE_DICT),
options_dict=ALLOWED_PHASE_DICT,
api_param="312E_0",
),
# 2 Socket devices
# AlfenSelectDescription(
# key="lb_max_allowed_phase_socket_2",
# name="Load Balancing Max Allowed of Phases Socket 2",
# icon="mdi:balance-scale",
# options=list(ALLOWED_PHASE_DICT),
# options_dict=ALLOWED_PHASE_DICT,
# api_param="312F_0",
# ),
AlfenSelectDescription(
key="bo_network_1_connection_priority",
name="Backoffice Network 1 Connection Priority (Ethernet)",
icon="mdi:ethernet-cable",
options=list(PRIORITIES_DICT),
options_dict=PRIORITIES_DICT,
api_param="20F0_E",
),
AlfenSelectDescription(
key="bo_network_2_connection_priority",
name="Backoffice Network 2 Connection Priority (GPRS)",
icon="mdi:antenna",
options=list(PRIORITIES_DICT),
options_dict=PRIORITIES_DICT,
api_param="20F1_E",
),
AlfenSelectDescription(
key="socket_1_operation_mode",
name="Socket 1 Operation Mode",
icon="mdi:power-socket-eu",
options=list(OPERATIVE_MODE_DICT),
options_dict=OPERATIVE_MODE_DICT,
api_param="205F_0",
),





)

Expand Down

0 comments on commit 62918b9

Please sign in to comment.