2121
2222
2323class AttrR (Attribute [DType_T , AttributeIORefT ]):
24- """A read-only ``Attribute``. """
24+ """A read-only ``Attribute``"""
2525
2626 def __init__ (
2727 self ,
@@ -44,7 +44,7 @@ def get(self) -> DType_T:
4444 """Get the cached value of the attribute."""
4545 return self ._value
4646
47- async def update (self , value : DType_T ) -> None :
47+ async def update (self , value : Any ) -> None :
4848 """Update the value of the attibute
4949
5050 This sets the cached value of the attribute presented in the API. It should
@@ -54,8 +54,16 @@ async def update(self, value: DType_T) -> None:
5454 To request a change to the setpoint of the attribute, use the ``put`` method,
5555 which will attempt to apply the change to the underlying source.
5656
57+ Args:
58+ value: The new value of the attribute
59+
60+ Raises:
61+ ValueError: If the value fails to be validated to DType_T
62+
5763 """
58- self .log_event ("Attribute set" , attribute = self , value = value )
64+ self .log_event (
65+ "Attribute set" , value = value , value_type = type (value ), attribute = self
66+ )
5967
6068 self ._value = self ._datatype .validate (value )
6169
@@ -66,7 +74,7 @@ async def update(self, value: DType_T) -> None:
6674 )
6775 except Exception as e :
6876 logger .opt (exception = e ).error (
69- "On update callback failed" , attribute = self , value = value
77+ "On update callbacks failed" , attribute = self , value = value
7078 )
7179 raise
7280
0 commit comments