diff --git a/pyproject.toml b/pyproject.toml index ec267b8a..97b8f428 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "gridworks-protocol" -version = "0.6.1" +version = "0.6.2" description = "Gridworks Protocol" authors = ["Jessica Millar "] license = "MIT" diff --git a/src/gwproto/data_classes/components/pipe_flow_sensor_component.py b/src/gwproto/data_classes/components/pipe_flow_sensor_component.py index ad6207e9..3df810e4 100644 --- a/src/gwproto/data_classes/components/pipe_flow_sensor_component.py +++ b/src/gwproto/data_classes/components/pipe_flow_sensor_component.py @@ -16,6 +16,7 @@ def __init__( component_attribute_class_id: str, conversion_factor: float, i2c_address: int, + poll_period_s: Optional[float], display_name: Optional[str] = None, hw_uid: Optional[str] = None, ): @@ -27,6 +28,7 @@ def __init__( ) self.i2c_address = i2c_address self.conversion_factor = conversion_factor + self.poll_period_s = poll_period_s PipeFlowSensorComponent.by_id[self.component_id] = self Component.by_id[self.component_id] = self diff --git a/src/gwproto/types/pipe_flow_sensor_component_gt.py b/src/gwproto/types/pipe_flow_sensor_component_gt.py index af23cf61..81671f2c 100644 --- a/src/gwproto/types/pipe_flow_sensor_component_gt.py +++ b/src/gwproto/types/pipe_flow_sensor_component_gt.py @@ -190,6 +190,10 @@ def dict_to_tuple(cls, d: dict[str, Any]) -> PipeFlowSensorComponentGt: DisplayName=d2["DisplayName"], HwUid=d2["HwUid"], TypeName=d2["TypeName"], + PollPeriodS=d2.get( + "PollPeriodS", + PipeFlowSensorComponentGt.__fields__["PollPeriodS"].default, + ), Version="000", ) @@ -203,6 +207,7 @@ def tuple_to_dc(cls, t: PipeFlowSensorComponentGt) -> PipeFlowSensorComponent: component_attribute_class_id=t.ComponentAttributeClassId, i2c_address=t.I2cAddress, conversion_factor=t.ConversionFactor, + poll_period_s=t.PollPeriodS, display_name=t.DisplayName, hw_uid=t.HwUid, )