11from dataclasses import KW_ONLY , dataclass
22
3- from fastcs .attribute_io import AttributeIO
4- from fastcs .attribute_io_ref import AttributeIORef
5- from fastcs .attributes import AttrR , AttrW
6- from fastcs .datatypes import T
3+ from fastcs .attributes import AttributeIO , AttributeIORef , AttrR , AttrW
4+ from fastcs .datatypes import DType_T
75from fastcs .logging import bind_logger
86
97from fastcs_odin .http_connection import HTTPConnection , ValueType
@@ -27,15 +25,15 @@ class ParameterTreeAttributeIORef(AttributeIORef):
2725 update_period : float | None = 0.2
2826
2927
30- class ParameterTreeAttributeIO (AttributeIO [T , ParameterTreeAttributeIORef ]):
28+ class ParameterTreeAttributeIO (AttributeIO [DType_T , ParameterTreeAttributeIORef ]):
3129 """AttributeIO for ``ParameterTreeAttributeIORef`` Attributes"""
3230
3331 def __init__ (self , connection : HTTPConnection ):
3432 super ().__init__ ()
3533
3634 self ._connection = connection
3735
38- async def update (self , attr : AttrR [T , ParameterTreeAttributeIORef ]) -> None :
36+ async def update (self , attr : AttrR [DType_T , ParameterTreeAttributeIORef ]) -> None :
3937 # TODO: We should use pydantic validation here
4038 response = await self ._connection .get (attr .io_ref .path )
4139
@@ -47,7 +45,9 @@ async def update(self, attr: AttrR[T, ParameterTreeAttributeIORef]) -> None:
4745 value = response .get (parameter )
4846 await attr .update (attr .datatype .validate (value ))
4947
50- async def send (self , attr : AttrW [T , ParameterTreeAttributeIORef ], value : T ) -> None :
48+ async def send (
49+ self , attr : AttrW [DType_T , ParameterTreeAttributeIORef ], value : DType_T
50+ ) -> None :
5151 assert isinstance (value , ValueType )
5252 logger .info ("Sending parameter" , path = attr .io_ref .path , value = value )
5353 response = await self ._connection .put (attr .io_ref .path , value )
0 commit comments