Repository navigation
Leave a failed login disconnected and return bool on/off values - #8
Merged
Merged
Conversation
async_connect set self.api before the login, so after a refused login async_discover and async_hello still called the cloud with no token. self.api is now set only on success. A new login also drops the device list, as it may belong to another account. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
GALEVO and BSB share is_flame_on_value, is_heating_pump_on_value and get_zone_heat_request_value, but gave different types: GALEVO passed on the cloud's 0.0 / 1.0, BSB flame was False when missing. Both now give True, False or None (no value), which the integration's "is not None" checks expect. GALEVO get_measured_temp_value is typed float | None. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review of the first version: it cleared api and the device list before the login, so a cloud error dropped a working login, each re-login listed the devices again, and a login during a running hello or discover could give a device with api None or keep the old account's list. Now a cloud error keeps the earlier login, the list is dropped only for another account, and hello and discover keep the api they started with. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
holiday_mode_value, automatic_thermoregulation and is_quiet_value also passed on the cloud's 0.0 / 1.0. BSB get_zone_heat_request_value now takes zone_number, like GALEVO, so keyword calls work on both. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
After a refused login
Aristonis "not connected" (apiisNone). A cloud error during a login keeps the earlier one, and a login to another account drops the old device list.GALEVO on/off values (flame, heat pump, zone heat request, holiday, automatic thermoregulation, quiet) now give
True/False/Noneinstead of the cloud's 0.0 / 1.0; BSB flame isNonewhen missing.Follow-up to #7 (the three points its review left out). Stacked on #7; GitHub moves it to
mainwhen #7 merges. Patch release, no label.Changes
Ariston.async_connect: setsapionly after the login works; a refused login sets it toNone; aConnectionException(timeout, 429 block, 5xx) leaves the earlier login as it was. The device list is dropped only when(api_url, username)changes, so a re-login of the same account sends no extra requests.async_discover/async_hellokeep theapithey started with. A list that comes back after another login is returned but not stored, so a login during a running hello cannot give a device withapi=Noneor keep the old account's list._get_bool_item_by_id, used byis_flame_on_value,is_heating_pump_on_value,get_zone_heat_request_value,holiday_mode_value,automatic_thermoregulation,is_quiet_value(allbool | None). The owner's Nimbus data has these as floats (0.0 / 1.0); the setters already write 1.0 / 0.0.get_measured_temp_valueis typedfloat | None(annotation only, same as BSB).is_flame_on_valueisNonewhenflameis missing (wasFalse);get_zone_heat_request_valuetakeszone_numberlike GALEVO (new in Read BSB heat pump state and skip a missing room sensor #7, not released).Integration impact
Aristonper setup or flow and checks the login result, so the connect change does not change its behaviour.heat_requestshowstrue/falseinstead of1.0/0.0. Binary sensor and switch states andhvac_actionstay the same (truthiness of the same values).flameis notNone. Real BSB data has every key (fustom#173), so the sensor stays; a first refresh with no data at all would skip it, as GALEVO already does.Review (/code-review)
Fixed: login race with a running hello/discover, a cloud error dropping a working login, re-listing devices for the same account, other GALEVO on/off getters, BSB parameter name.
Not changed:
Nonewhen missing: this is the change asked for; see "Integration impact".bool()truthiness in_get_bool_item_by_id(a string "0" would beTrue): the cloud sends numbers, and the integration already appliedbool()/ truthiness to the raw value, so nothing changes._async_connect: it raises for both a refused login and a cloud error, andasync_connectmust tell them apart.Tests
tests/test_package.py: refused login → not connected, no cloud call; cloud error keeps the login; same account keeps the list, another account lists again; a refused login during a running hello.tests/test_galevo_device.py(new): six on/off values from 1.0 / 0.0 / bool and missing; zone heat request per zone.tests/test_bsb_device.py: flame and heat pump on / off / missing; heat request by keywordzone_number.v1/15-entity-names-sensorspasses 597 tests and 355 snapshots with this branch onPYTHONPATH.🤖 Generated with Claude Code