Description
Currently, all numeric DataPoint classes e.g. DataPointInt8, DataPointInt16, ... only store their names and their parent. However it would be very convenient if they would also store their min / max values and the unit, if they exist.
This would
- enable the vehicle-model-generator to properly fill these attributes.
- the vehicle model to be compared against the running model in kuksa databroker (compatibility checks)
- the datapoint classes to raise exceptions when trying to set values outside of the allowed range without communicating with kuksa databroker
Suggested Solution
One option would be to pull in a new base class for numeric types which accepts kwargs for modular extension:
class DataPointNumeric(DataPoint, Generic[T]):
"""Base class for numeric datapoints."""
def __init__(self, name: str, parent: Node, **kwargs):
super().__init__(name, parent)
self.min = kwargs.get("min")
self.max = kwargs.get("max")
self.unit = kwargs.get("unit")
Alternatives
No response
Additional Context
No response
Description
Currently, all numeric DataPoint classes e.g. DataPointInt8, DataPointInt16, ... only store their names and their parent. However it would be very convenient if they would also store their min / max values and the unit, if they exist.
This would
Suggested Solution
One option would be to pull in a new base class for numeric types which accepts kwargs for modular extension:
Alternatives
No response
Additional Context
No response