Skip to content

Commit

Permalink
Merge pull request #81 from leeyuentuen/dev
Browse files Browse the repository at this point in the history
fix #80 add disconnect action and disconnect timeout on car disconnect
  • Loading branch information
leeyuentuen authored Nov 11, 2023
2 parents fc89a26 + 5e7eff8 commit 8f5817e
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 0 deletions.
47 changes: 47 additions & 0 deletions custom_components/alfen_wallbox/number.py
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,53 @@ class AlfenNumberDescription(NumberEntityDescription, AlfenNumberDescriptionMixi
api_param="3262_4",
round_digits=2
),
AlfenNumberDescription(
key="ev_disconnection_timeout",
name="Car Disconnection Timeout (s)",
state=None,
icon="mdi:timer-sand",
assumed_state=False,
device_class=None,
native_min_value=0,
native_max_value=30,
native_step=1,
custom_mode=None,
unit_of_measurement=CURRENCY_EURO,
api_param="2136_0",
round_digits=None
),

AlfenNumberDescription(
key="ev_non_charging_report_threshold",
name="Car Time to Report Not Charging (s)",
state=None,
icon="mdi:timer-sand",
assumed_state=False,
device_class=None,
native_min_value=0,
native_max_value=30,
native_step=1,
custom_mode=None,
unit_of_measurement=CURRENCY_EURO,
api_param="2184_0",
round_digits=None
),

AlfenNumberDescription(
key="ev_auto_stop_transaction_time",
name="Car Time to Unlock Not Charging (s)",
state=None,
icon="mdi:timer-sand",
assumed_state=False,
device_class=None,
native_min_value=0,
native_max_value=30,
native_step=1,
custom_mode=None,
unit_of_measurement=CURRENCY_EURO,
api_param="2168_0",
round_digits=None
),

)

Expand Down
17 changes: 17 additions & 0 deletions custom_components/alfen_wallbox/select.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,13 @@ class AlfenSelectDescription(SelectEntityDescription, AlfenSelectDescriptionMixi
"UNKNOWN": 99,
}

CAR_DISCONNECT_ACTION_DICT: Final[dict[str, int]] = {
"Continue": 0,
'Abort Lock': 1,
'Abort Unlock': 2,
'Abort Unlock When Offline': 3,
}

ALFEN_SELECT_TYPES: Final[tuple[AlfenSelectDescription, ...]] = (
AlfenSelectDescription(
key="lb_solar_charging_mode",
Expand Down Expand Up @@ -277,6 +284,16 @@ class AlfenSelectDescription(SelectEntityDescription, AlfenSelectDescriptionMixi
options_dict=SOCKET_TYPE_DICT,
api_param="2125_0",
),
AlfenSelectDescription(
key="ev_disconnect_action",
name="Car Disconnect Action",
icon="mdi:cable-data",
options=list(CAR_DISCONNECT_ACTION_DICT),
options_dict=CAR_DISCONNECT_ACTION_DICT,
api_param="2137_0",
),


)

ALFEN_SELECT_DUAL_SOCKET_TYPES: Final[tuple[AlfenSelectDescription, ...]] = (
Expand Down

0 comments on commit 8f5817e

Please sign in to comment.