Support Knuspr.de, Gurkerl.at, Kifli.hu and Sezamo.ro - #92
Conversation
The Rohlík Group shops all run the same backend, and older versions could be pointed at another shop by editing BASE_URL in the in-tree client. That file went away with the move to the rohlik-api package, leaving every entry hard-wired to Rohlík.cz and CZK. - Config flow: pick the shop when adding the account; it is stored on the entry and passed to RohlikAPI as base_url. Entries without one stay on Rohlík.cz. Reauth keeps the entry's shop. - New reconfigure step so existing entries (e.g. set up against Knuspr.de on an old version) can switch shop without being removed and re-added. - Money sensors (credit, cart total, spent this month/year/all time), the calendar and the cart todo use the shop's currency instead of CZK/Kč. Czech-language installs on Rohlík.cz keep the "Kč" unit they had, so long-term statistics do not see a unit change. - Month/year boundaries and announcement clock times use the shop's timezone (matters for Sezamo.ro, Europe/Bucharest). - Device manufacturer shows the shop name. - Credit Balance reports unknown instead of the string "N/A" when missing, as a sensor with a unit must be numeric. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0135WLPbnfESWnAJmw4P8uRH
… times - Reconfigure: entries from before unique ids existed have none to compare against, so the mismatch check always aborted with wrong_account. Adopt the account's id instead, unless another entry already has it. - Load the shop's timezone with dt_util.async_get_time_zone in setup, so reading tzdata never blocks the event loop; the coordinator takes it from the cache. - The last-refresh time uses the shop's timezone and the order store's tracking_since uses HA's, instead of a hardcoded Europe/Prague. - get_site() is the one place that defaults to Rohlík.cz; drop the unused RohlikAccount.site property. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0135WLPbnfESWnAJmw4P8uRH
|
@claude review this PR. Focus on correctness bugs, Home Assistant conventions (config/reconfigure flow, translations, sensor units) and regressions for existing Rohlík.cz entries. Generated by Claude Code |
|
Claude finished @dvejsada's task in 4m 5s —— View job Review: Multi-shop support (Knuspr.de, Gurkerl.at, Kifli.hu, Sezamo.ro)
No correctness bugs found. This is a careful, well-scoped change. Highlights of what I checked and why it holds up: Config/reconfigure flow (
Timezone preloading (
Currency/unit handling (
Regressions for existing Rohlík.cz entries
Minor, non-blocking observations (not raised as findings — already acknowledged in the PR description itself):
Not run: I wasn't able to execute |
|
Thanks for the quick update. Knuspr.de is working as expected for me now, and in Euro too. I also tried out the cards, the currency is still incorrect there. |
@IngoPodolak Thanks, please kindly open the issues in cards repo for both currency and translations, much appreciated. |
Fixes #91.
Why
All Rohlík Group shops run the same backend. Older versions could be pointed at Knuspr.de by editing
BASE_URLin the in-tree client. That file went away when the integration moved to therohlik-apipackage (db61166), so every entry was stuck on Rohlík.cz and CZK.rohlik-apialready accepts abase_url; the integration just never passed one. No library change is needed.I checked the login, first-delivery and cart endpoints on all five shops: each answers the same requests with the same response shape (for the login check I sent a made-up e-mail and got the usual
401 login.invalid_credentialsback). I have not logged into a real non-Czech account.Changes
RohlikAPIasbase_url. Entries without one stay on Rohlík.cz, and re-authentication keeps the entry's shop.Kč, so long-term statistics see no unit change."N/A"when the value is missing, because a sensor with a unit must hold a number.Review notes
A code review ran on the branch, and its fixes are in the second commit. Two findings were deliberately left out:
The library's own multi-shop follow-up is tracked in dvejsada/rohlik_api_python#10: publishing the shop list, adding a currency to the cart models, and removing "CZK" from its docs. Once that ships, the integration can drop its own shop table.
Testing
python -m pytest tests/: 75 passed.validate_inputusing the shop's URLKč🤖 Generated with Claude Code
https://claude.ai/code/session_0135WLPbnfESWnAJmw4P8uRH
Generated by Claude Code