From 36b402505091cc771b652ed20328011756f94c85 Mon Sep 17 00:00:00 2001 From: Teemu R Date: Tue, 5 Dec 2023 01:32:15 +0100 Subject: [PATCH] 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. --- miio/device.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/miio/device.py b/miio/device.py index ef85531a4..8f2c8a374 100644 --- a/miio/device.py +++ b/miio/device.py @@ -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, )