Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion homeassistant/components/kostal_plenticore/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
{
vol.Required(CONF_HOST): str,
vol.Required(CONF_PASSWORD): str,
vol.Optional("Service Code"): str,
}
)

Expand All @@ -33,7 +34,7 @@ async def test_connection(hass: HomeAssistant, data) -> str:

session = async_get_clientsession(hass)
async with ApiClient(session, data["host"]) as client:
await client.login(data["password"])
await client.login(data["password"], service_code=data.get("Service Code"))
hostname_id = await get_hostname_id(client)
values = await client.get_setting_values("scb:network", hostname_id)

Expand Down
5 changes: 4 additions & 1 deletion homeassistant/components/kostal_plenticore/coordinator.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,10 @@ async def async_setup(self) -> bool:
async_get_clientsession(self.hass), host=self.host
)
try:
await self._client.login(self.config_entry.data[CONF_PASSWORD])
await self._client.login(
self.config_entry.data[CONF_PASSWORD],
service_code=self.config_entry.data.get("Service Code"),
)
except AuthenticationException as err:
_LOGGER.error(
"Authentication exception connecting to %s: %s", self.host, err
Expand Down
10 changes: 10 additions & 0 deletions homeassistant/components/kostal_plenticore/switch.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,16 @@ class PlenticoreSwitchEntityDescription(SwitchEntityDescription):
off_value="2",
off_label="Automatic economical",
),
PlenticoreSwitchEntityDescription(
module_id="devices:local",
key="Battery:ManualCharge",
name="Battery Manual Charge",
is_on="1",
on_value="1",
on_label="On",
off_value="0",
off_label="Off",
),
]


Expand Down