-
Notifications
You must be signed in to change notification settings - Fork 23
Description
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?