All `Sensor` instances should have `is_read_only=True` by default

This commit is contained in:
Fabio Manganiello 2023-01-22 21:05:14 +01:00
parent fd76642082
commit 147f36c86c
Signed by: blacklight
GPG Key ID: D90FBA7F76362774
1 changed files with 3 additions and 0 deletions

View File

@ -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: