From 0dac9c6d84cf8b587e7741170288a59f50fe52ac Mon Sep 17 00:00:00 2001 From: Ernst Klamer Date: Thu, 20 Jun 2024 11:07:25 +0200 Subject: [PATCH] disable some sensors by default --- custom_components/ble_monitor/binary_sensor.py | 2 ++ custom_components/ble_monitor/sensor.py | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/custom_components/ble_monitor/binary_sensor.py b/custom_components/ble_monitor/binary_sensor.py index fb1b4364..d8e2b32c 100644 --- a/custom_components/ble_monitor/binary_sensor.py +++ b/custom_components/ble_monitor/binary_sensor.py @@ -361,6 +361,8 @@ def entity_registry_enabled_default(self): """Return if the entity should be enabled when first added to the entity registry.""" if self._device_type == "ATC": return False + elif self.entity_description.key == 'reset': + return False else: return True diff --git a/custom_components/ble_monitor/sensor.py b/custom_components/ble_monitor/sensor.py index 7935b662..fcf1bd18 100644 --- a/custom_components/ble_monitor/sensor.py +++ b/custom_components/ble_monitor/sensor.py @@ -531,7 +531,10 @@ def entity_registry_enabled_default(self) -> bool: if not self.is_beacon: return True - if self.entity_description.key in ['cypress temperature', 'cypress humidity', 'uuid']: + if self.entity_description.key in [ + 'cypress temperature', 'cypress humidity', 'uuid', 'pressure present duration', + 'pressure not present duration', 'pressure present time set', 'pressure not present time set' + ]: return False return True