Skip to content

Commit

Permalink
Fix fan id again
Browse files Browse the repository at this point in the history
  • Loading branch information
IDmedia committed Mar 8, 2024
1 parent 4b02288 commit 419ccb6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
5 changes: 1 addition & 4 deletions app/parsers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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())

Expand Down
1 change: 1 addition & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ services:
container_name: hass-unraid
network_mode: bridge
restart: always
# build: ./
environment:
- TZ=Europe/Oslo
volumes:
Expand Down

0 comments on commit 419ccb6

Please sign in to comment.