@@ -26,6 +26,7 @@ def __init__(self, od: objectdictionary.Variable):
26
26
self .subindex = od .subindex
27
27
28
28
def get_data (self ) -> bytes :
29
+ """Byte representation of the object as :class:`bytes`."""
29
30
raise NotImplementedError ("Variable is not readable" )
30
31
31
32
async def aget_data (self ) -> bytes :
@@ -39,8 +40,7 @@ async def aset_data(self, data: bytes):
39
40
40
41
@property
41
42
def data (self ) -> bytes :
42
- """Byte representation of the object as :class:`bytes`."""
43
- logger .warning ("Accessing Variable.data property is deprecated" )
43
+ logger .warning ("Accessing Variable.data property is deprecated, use get_data()" )
44
44
return self .get_data ()
45
45
46
46
@data .setter
@@ -50,7 +50,7 @@ def data(self, data: bytes):
50
50
51
51
@property
52
52
def raw (self ) -> Union [int , bool , float , str , bytes ]:
53
- logger .warning ("Accessing Variable.raw property is deprecated" )
53
+ logger .warning ("Accessing Variable.raw property is deprecated, use get_raw() " )
54
54
return self .get_raw ()
55
55
56
56
def get_raw (self ) -> Union [int , bool , float , str , bytes ]:
@@ -119,7 +119,7 @@ def _set_raw(self, value: Union[int, bool, float, str, bytes]):
119
119
120
120
@property
121
121
def phys (self ) -> Union [int , bool , float , str , bytes ]:
122
- logger .warning ("Accessing Variable.phys attribute is deprecated" )
122
+ logger .warning ("Accessing Variable.phys attribute is deprecated, use get_phys() " )
123
123
return self .get_phys ()
124
124
125
125
def get_phys (self ) -> Union [int , bool , float , str , bytes ]:
@@ -153,11 +153,11 @@ async def aset_phys(self, value: Union[int, bool, float, str, bytes]):
153
153
154
154
@property
155
155
def desc (self ) -> str :
156
- """Converts to and from a description of the value as a string."""
157
- logger .warning ("Accessing Variable.desc attribute is deprecated" )
156
+ logger .warning ("Accessing Variable.desc attribute is deprecated, use get_desc()" )
158
157
return self .get_desc ()
159
158
160
159
def get_desc (self ) -> str :
160
+ """Converts to and from a description of the value as a string."""
161
161
value = self .od .decode_desc (self .get_raw ())
162
162
logger .debug ("Description is '%s'" , value )
163
163
return value
@@ -180,8 +180,11 @@ async def aset_desc(self, desc: str):
180
180
181
181
@property
182
182
def bits (self ) -> "Bits" :
183
- """Access bits using integers, slices, or bit descriptions."""
184
183
logger .warning ("Accessing Variable.bits attribute is deprecated" )
184
+ return self .get_bits ()
185
+
186
+ def get_bits (self ) -> "Bits" :
187
+ """Access bits using integers, slices, or bit descriptions."""
185
188
return Bits (self )
186
189
187
190
def read (self , fmt : str = "raw" ) -> Union [int , bool , float , str , bytes ]:
0 commit comments