Skip to content

Commit

Permalink
Make Device.sensors() only return read-only descriptors (#1871)
Browse files Browse the repository at this point in the history
This was incorrectly returning also readable settings, this changes the
behavior to conform with the docstring.
  • Loading branch information
rytilahti committed Dec 5, 2023
1 parent 927b112 commit 36b4025
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion miio/device.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ def sensors(self) -> DescriptorCollection[PropertyDescriptor]:
{
k: v
for k, v in self.descriptors().items()
if isinstance(v, PropertyDescriptor) and v.access & AccessFlags.Read
if v.access == AccessFlags.Read
},
device=self,
)
Expand Down

0 comments on commit 36b4025

Please sign in to comment.