Skip to content

Commit

Permalink
fix #34 add network selection, fix #33 change boost from select to sw…
Browse files Browse the repository at this point in the history
…itch
  • Loading branch information
Tuen Lee committed Aug 5, 2023
1 parent 5ae450e commit 0bff3c2
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 14 deletions.
42 changes: 28 additions & 14 deletions custom_components/alfen_wallbox/select.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ class AlfenSelectDescription(SelectEntityDescription, AlfenSelectDescriptionMixi
CHARGING_MODE_DICT: Final[dict[str, int]] = {
"Disable": 0, "Comfort": 1, "Green": 2}

ON_OFF_DICT: Final[dict[str, int]] = {"Off": 0, "On": 1}

PHASE_ROTATION_DICT: Final[dict[str, str]] = {
"L1": "L1",
"L2": "L2",
Expand Down Expand Up @@ -118,6 +116,17 @@ class AlfenSelectDescription(SelectEntityDescription, AlfenSelectDescriptionMixi
"In-operative": 2,
}

GPRS_NETWORK_MODE_DICT: Final[dict[str, int]] = {
"Automatic": 0,
"Manual": 1
}

GPRS_TECHNOLOGY_DICT: Final[dict[str, int]] = {
"2G": 0,
"4G": 2,
}


ALFEN_SELECT_TYPES: Final[tuple[AlfenSelectDescription, ...]] = (
AlfenSelectDescription(
key="lb_solar_charging_mode",
Expand All @@ -127,14 +136,7 @@ class AlfenSelectDescription(SelectEntityDescription, AlfenSelectDescriptionMixi
options_dict=CHARGING_MODE_DICT,
api_param="3280_1",
),
AlfenSelectDescription(
key="lb_solar_charging_boost",
name="Solar Charging Boost",
icon="mdi:ev-station",
options=list(ON_OFF_DICT),
options_dict=ON_OFF_DICT,
api_param="3280_4",
),

AlfenSelectDescription(
key="alb_phase_connection",
name="Active Load Balancing Phase Connection",
Expand Down Expand Up @@ -209,10 +211,22 @@ class AlfenSelectDescription(SelectEntityDescription, AlfenSelectDescriptionMixi
options_dict=OPERATIVE_MODE_DICT,
api_param="205F_0",
),




AlfenSelectDescription(
key="gprs_network_mode",
name="GPRS Network Mode",
icon="mdi:antenna",
options=list(GPRS_NETWORK_MODE_DICT),
options_dict=GPRS_NETWORK_MODE_DICT,
api_param="2113_0",
),
AlfenSelectDescription(
key="gprs_technology",
name="GPRS Technology",
icon="mdi:antenna",
options=list(GPRS_TECHNOLOGY_DICT),
options_dict=GPRS_TECHNOLOGY_DICT,
api_param="2114_0",
),

)

Expand Down
5 changes: 5 additions & 0 deletions custom_components/alfen_wallbox/switch.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ class AlfenSwitchDescription(SwitchEntityDescription, AlfenSwitchDescriptionMixi
name="Display Light Auto Dim",
api_param="2061_1",
),
AlfenSwitchDescription(
key="lb_solar_charging_boost",
name="Solar Charging Boost",
api_param="3280_4",
),
)


Expand Down

0 comments on commit 0bff3c2

Please sign in to comment.