@@ -25,23 +25,12 @@ def _wrap_updater_fget(
25
25
attr_name : str , attribute : AttrR , controller : BaseController
26
26
) -> Callable [[Any ], Any ]:
27
27
async def fget (tango_device : Device ):
28
- assert attribute .updater is not None
29
-
30
- await attribute .updater .update (controller , attribute )
31
28
tango_device .info_stream (f"called fget method: { attr_name } " )
32
29
return attribute .get ()
33
30
34
31
return fget
35
32
36
33
37
- def _tango_polling_period (attribute : AttrR ) -> int :
38
- if attribute .updater is not None :
39
- # Convert to integer milliseconds
40
- return int (attribute .updater .update_period * 1000 )
41
-
42
- return - 1 # `tango.server.attribute` default for `polling_period`
43
-
44
-
45
34
def _tango_display_format (attribute : Attribute ) -> str :
46
35
match attribute .datatype :
47
36
case Float (prec ):
@@ -54,10 +43,8 @@ def _wrap_updater_fset(
54
43
attr_name : str , attribute : AttrW , controller : BaseController
55
44
) -> Callable [[Any , Any ], Any ]:
56
45
async def fset (tango_device : Device , val ):
57
- assert attribute .sender is not None
58
-
59
- await attribute .sender .put (controller , attribute , val )
60
46
tango_device .info_stream (f"called fset method: { attr_name } " )
47
+ await attribute .process_without_display_update (val )
61
48
62
49
return fset
63
50
@@ -84,7 +71,6 @@ def _collect_dev_attributes(mapping: Mapping) -> dict[str, Any]:
84
71
),
85
72
access = AttrWriteType .READ_WRITE ,
86
73
format = _tango_display_format (attribute ),
87
- polling_period = _tango_polling_period (attribute ),
88
74
)
89
75
case AttrR ():
90
76
collection [d_attr_name ] = server .attribute (
@@ -95,7 +81,6 @@ def _collect_dev_attributes(mapping: Mapping) -> dict[str, Any]:
95
81
attr_name , attribute , single_mapping .controller
96
82
),
97
83
format = _tango_display_format (attribute ),
98
- polling_period = _tango_polling_period (attribute ),
99
84
)
100
85
case AttrW ():
101
86
collection [d_attr_name ] = server .attribute (
@@ -146,7 +131,6 @@ def _collect_dev_init(mapping: Mapping) -> dict[str, Callable]:
146
131
async def init_device (tango_device : Device ):
147
132
await server .Device .init_device (tango_device ) # type: ignore
148
133
tango_device .set_state (DevState .ON )
149
- await mapping .controller .connect ()
150
134
151
135
return {"init_device" : init_device }
152
136
@@ -186,13 +170,13 @@ def run(self, options: TangoDSROptions | None = None) -> None:
186
170
187
171
class_bases = (server .Device ,)
188
172
pytango_class = type (options .dev_class , class_bases , class_dict )
189
- register_dev (options .dev_name , options .dev_class , options .dsr_instance )
190
173
191
174
dsr_args = _collect_dsr_args (options )
192
175
193
176
server .run (
194
177
(pytango_class ,),
195
178
[options .dev_class , options .dsr_instance , * dsr_args ],
179
+ green_mode = server .GreenMode .Asyncio ,
196
180
)
197
181
198
182
0 commit comments