mirror of
https://github.com/google/bumble.git
synced 2026-05-09 04:08:02 +00:00
address PR comments
This commit is contained in:
@@ -885,9 +885,7 @@ class Attribute(EventEmitter, Generic[_T]):
|
|||||||
)
|
)
|
||||||
|
|
||||||
value: Union[_T, None]
|
value: Union[_T, None]
|
||||||
if self.value is None:
|
if isinstance(self.value, AttributeValue):
|
||||||
value = None
|
|
||||||
elif hasattr(self.value, 'read'):
|
|
||||||
try:
|
try:
|
||||||
read_value = self.value.read(connection)
|
read_value = self.value.read(connection)
|
||||||
if inspect.isawaitable(read_value):
|
if inspect.isawaitable(read_value):
|
||||||
@@ -930,7 +928,7 @@ class Attribute(EventEmitter, Generic[_T]):
|
|||||||
|
|
||||||
decoded_value = self.decode_value(value)
|
decoded_value = self.decode_value(value)
|
||||||
|
|
||||||
if self.value is not None and hasattr(self.value, 'write'):
|
if isinstance(self.value, AttributeValue):
|
||||||
try:
|
try:
|
||||||
result = self.value.write(connection, decoded_value)
|
result = self.value.write(connection, decoded_value)
|
||||||
if inspect.isawaitable(result):
|
if inspect.isawaitable(result):
|
||||||
|
|||||||
Reference in New Issue
Block a user