From 147f36c86cbae04cdf6b4d2aee57ddb80c47ea59 Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Sun, 22 Jan 2023 21:05:14 +0100 Subject: [PATCH] All `Sensor` instances should have `is_read_only=True` by default --- platypush/entities/sensors.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/platypush/entities/sensors.py b/platypush/entities/sensors.py index 3cad5916..a47c91c8 100644 --- a/platypush/entities/sensors.py +++ b/platypush/entities/sensors.py @@ -20,6 +20,9 @@ logger = logging.getLogger(__name__) class Sensor(Device): __abstract__ = True + def __init__(self, *args, is_read_only=True, **kwargs): + super().__init__(*args, is_read_only=is_read_only, **kwargs) + if 'raw_sensor' not in Base.metadata: