Skip to content

Commit 36b4025

Browse files
authored
Make Device.sensors() only return read-only descriptors (#1871)
This was incorrectly returning also readable settings, this changes the behavior to conform with the docstring.
1 parent 927b112 commit 36b4025

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

miio/device.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ def sensors(self) -> DescriptorCollection[PropertyDescriptor]:
299299
{
300300
k: v
301301
for k, v in self.descriptors().items()
302-
if isinstance(v, PropertyDescriptor) and v.access & AccessFlags.Read
302+
if v.access == AccessFlags.Read
303303
},
304304
device=self,
305305
)

0 commit comments

Comments
 (0)