Skip to content

Commit 128bb92

Browse files
committed
feat(ev): carry EV-only sensors on upstream base
1 parent 601326b commit 128bb92

4 files changed

Lines changed: 318 additions & 8 deletions

File tree

custom_components/toyota/config_flow.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
CONF_AUTO_DISABLED_STATUS_REFRESH,
1919
CONF_BRAND,
2020
CONF_ENABLE_STATUS_REFRESH,
21+
CONF_EV_USABLE_BATTERY_KWH,
2122
CONF_FAILED_WAKE_THRESHOLD,
2223
CONF_IDLE_WAKE_HOURS,
2324
CONF_MAX_CACHE_AGE_MINUTES,
@@ -264,6 +265,18 @@ async def async_step_init(
264265
min=1, max=5, step=1, mode=selector.NumberSelectorMode.BOX
265266
)
266267
),
268+
vol.Optional(
269+
CONF_EV_USABLE_BATTERY_KWH,
270+
default=opts.get(CONF_EV_USABLE_BATTERY_KWH),
271+
): selector.NumberSelector(
272+
selector.NumberSelectorConfig(
273+
min=0,
274+
max=500,
275+
step=0.01,
276+
mode=selector.NumberSelectorMode.BOX,
277+
unit_of_measurement="kWh",
278+
)
279+
),
267280
}
268281
),
269282
)

custom_components/toyota/const.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
CONF_BRAND = "Brand"
2121
CONF_BRAND_MAPPING = {"T": "Toyota", "L": "Lexus"}
2222
CONF_METRIC_VALUES = "use_metric_values"
23+
CONF_EV_USABLE_BATTERY_KWH = "ev_usable_battery_kwh"
2324
# When True, per-vehicle cached data is returned on transient coordinator
2425
# failures (Toyota 429, connection timeouts, read timeouts) instead of
2526
# flipping entities to unavailable. Off by default for backward compatibility.

0 commit comments

Comments
 (0)