Skip to content

Multi-shop support: publish the known Rohlík Group shop URLs and stop assuming CZK #10

Description

@dvejsada

Background

dvejsada/HA-RohlikCZ#91 asks for Knuspr.de support. All Rohlík Group shops run the same backend. On 2026-09-27 I POSTed bogus credentials to /services/frontend-service/login on each shop below. Each one answered with the same 401 / login.invalid_credentials body as rohlik.cz, in its own language. GET /services/frontend-service/first-delivery and GET /services/frontend-service/v2/cart also return the same shapes on every shop:

Shop Base URL Currency Timezone
Rohlík.cz https://www.rohlik.cz CZK Europe/Prague
Knuspr.de https://www.knuspr.de EUR Europe/Berlin
Gurkerl.at https://www.gurkerl.at EUR Europe/Vienna
Kifli.hu https://www.kifli.hu HUF Europe/Budapest
Sezamo.ro https://www.sezamo.ro RON Europe/Bucharest

The library already supports this through RohlikAPI(base_url=...), and the integration now uses it (branch claude/ha-integration-open-issues-1hg1fx in HA-RohlikCZ). What's missing is small, but every consumer (HA integration, rohlik-mcp) currently has to work it out for itself.

Proposed changes

  1. Publish the known shops. For example, a Site dataclass or enum with base_url, currency and timezone, plus a SITES mapping exported from rohlik_api. Consumers could then write RohlikAPI(user, pw, base_url=SITES["de"].base_url) instead of each keeping its own copy of the table above. The HA integration keeps its own copy in const.py for now and can switch to this once it ships.
  2. Expose the currency on money-carrying models. Cart.total_price and CartItem.price are bare floats documented as "in the account currency (CZK)". The top level of the /v2/cart payload has no currency field, so it would come from the item price objects or from the site preset. Adding Cart.currency also covers the currency part of Feature request: expose the minimum order value (if the API returns it) #9.
  3. Drop the CZK / Rohlik.cz assumptions from the docs. Affected places:
    • the module docstring of models.py ("Czech crowns … are the usual currency")
    • the CartItem.price / Cart.total_price docstrings
    • the base_url docstrings in client.py / http_client.py ("Base URL for the Rohlik.cz API")
    • a README section showing how to target another shop

Out of scope

The text in delivery announcements comes localised from the server (e.g. Czech "za 5 minut"), and parsing it is the consumer's job. Nothing is needed in the library for that.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions