You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
class FieldDefinition(Enum):
car_battery_percentage= "vehicleStatus.battery.batSoc"
engine_is_running="vehicleStatus.engine"
for key, value in FieldDefinition:
setattr(vehicle, key, get_child_value(value))
The text was updated successfully, but these errors were encountered:
Now this integration looks for specific keys and uses those, what about using an opposite approach, loop through the returned data and for each field look for the key to use, if there is no mapping for a specific field a message can be logged that a not supported field was found which can be added pretty easily.
let's create an ENUM to map simple fields (non property) to respective key.
Current code;
New Code
The text was updated successfully, but these errors were encountered: