Skip to content

Charger type specific ID lookups in ZConst #341

@sveinse

Description

@sveinse

ZConst.update_ids_from_schema() sets .observations, .settings, and .commands attributes of ZConst providing integer to string translation (and back) for ID lookups. It use ZConst.get_remap() to generate the mapping from the provided charger device types.

Zaptec have a two stage system for constants, where some of it is global, and some that is specific to the charger. The idea of ZConst.update_ids_from_schema() was to get a list of all device types connected to a system and load them all into these dicts. However, one id mapping for one charger might not be valid on another charger. It is known that there are users with many chargers connected, so I'm wondering if this can cause issue for the user.

Perhaps the better solution is to make the three lookups self.observations, self.settings and self.commands dynamic and that one can pass a device type when looking up?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions