@@ -26,6 +26,7 @@ def __init__(self, od: objectdictionary.Variable):
2626 self .subindex = od .subindex
2727
2828 def get_data (self ) -> bytes :
29+ """Byte representation of the object as :class:`bytes`."""
2930 raise NotImplementedError ("Variable is not readable" )
3031
3132 async def aget_data (self ) -> bytes :
@@ -39,8 +40,7 @@ async def aset_data(self, data: bytes):
3940
4041 @property
4142 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()" )
4444 return self .get_data ()
4545
4646 @data .setter
@@ -50,7 +50,7 @@ def data(self, data: bytes):
5050
5151 @property
5252 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() " )
5454 return self .get_raw ()
5555
5656 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]):
119119
120120 @property
121121 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() " )
123123 return self .get_phys ()
124124
125125 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]):
153153
154154 @property
155155 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()" )
158157 return self .get_desc ()
159158
160159 def get_desc (self ) -> str :
160+ """Converts to and from a description of the value as a string."""
161161 value = self .od .decode_desc (self .get_raw ())
162162 logger .debug ("Description is '%s'" , value )
163163 return value
@@ -180,8 +180,11 @@ async def aset_desc(self, desc: str):
180180
181181 @property
182182 def bits (self ) -> "Bits" :
183- """Access bits using integers, slices, or bit descriptions."""
184183 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."""
185188 return Bits (self )
186189
187190 def read (self , fmt : str = "raw" ) -> Union [int , bool , float , str , bytes ]:
0 commit comments