From 419ccb6349362980e018aae646e08e704de8fb54 Mon Sep 17 00:00:00 2001 From: Benjamin Krause Date: Fri, 8 Mar 2024 10:49:26 +0100 Subject: [PATCH] Fix fan id again --- app/parsers.py | 5 +---- docker-compose.yaml | 1 + 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/app/parsers.py b/app/parsers.py index c3b75a8..97845fa 100644 --- a/app/parsers.py +++ b/app/parsers.py @@ -184,10 +184,6 @@ def temperature(self, msg_data, create_config): device_name = re.sub('fan', '', device_name, flags=re.IGNORECASE).strip() device_value = int(device_value) - # Let's align the fan numbering with the Unraid UI by adjusting it - if device_name.isdigit(): - device_name = str(int(device_name) + 1) - payload = { 'name': f'Fan {device_name} Speed', 'unit_of_measurement': 'RPM', @@ -227,6 +223,7 @@ def update1(self, msg_data, create_config): self.mqtt_publish(payload, 'sensor', memory_value, create_config=create_config) for fan_id, fan_rpm in enumerate(re.findall(re.compile(r'(\d+ RPM)'), msg_data)): + fan_id = fan_id + 1 fan_name = f'Fan {fan_id}' fan_value = ''.join(c for c in fan_rpm if c.isdigit()) diff --git a/docker-compose.yaml b/docker-compose.yaml index 0de6f38..057448b 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -5,6 +5,7 @@ services: container_name: hass-unraid network_mode: bridge restart: always + # build: ./ environment: - TZ=Europe/Oslo volumes: