Skip to content

Commit

Permalink
Added an exclusion list for useless or irrelevant sensors
Browse files Browse the repository at this point in the history
  • Loading branch information
albaintor committed Oct 15, 2024
1 parent 586971b commit f3a5e10
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
6 changes: 5 additions & 1 deletion custom_components/electrolux_status/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
SELECT,
SENSOR,
STATIC_ATTRIBUTES,
SWITCH,
SWITCH, IGNORED_ATTRIBUTES,
)
from .entity import ElectroluxEntity
from .number import ElectroluxNumber
Expand Down Expand Up @@ -419,6 +419,10 @@ def get_state(self, attr_name: str) -> dict[str, Any] | None:

def get_entity(self, capability: str) -> list[ElectroluxEntity] | None:
"""Return the entity."""
for ignored_partern in IGNORED_ATTRIBUTES:
if re.match(ignored_partern, capability):
return None

entity_type = self.data.get_entity_type(capability)
entity_name = self.data.get_entity_name(capability)
category = self.data.get_category(capability)
Expand Down
3 changes: 3 additions & 0 deletions custom_components/electrolux_status/const.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""The electrolux Status constants."""
import re

from homeassistant.const import Platform

Expand Down Expand Up @@ -74,3 +75,5 @@
"Türk": "tur",
"Ukrayna": "ukr",
}

IGNORED_ATTRIBUTES: [str] = [ "^fCMiscellaneous.+", "fcOptisenseLoadWeight"]
2 changes: 1 addition & 1 deletion custom_components/electrolux_status/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"issue_tracker": "https://github.com/albaintor/homeassistant_electrolux_status/issues",
"requirements": ["pyelectroluxocp==0.0.19"],
"ssdp": [],
"version": "2.0.1",
"version": "2.0.2",
"zeroconf": [],
"loggers": ["pyelectroluxocp"]
}

0 comments on commit f3a5e10

Please sign in to comment.