Skip to content

Commit

Permalink
Support for AEG Devices & de.json (#61)
Browse files Browse the repository at this point in the history
* Added AEG PX7 Purifier

* Update AEG Devices AX7 AX9

* Created German Translation

* Translation of States

* Update Translation & States

* Update api.py

---------

Co-authored-by: Johan Nenzén <[email protected]>
  • Loading branch information
MickLesk and JohNan authored Aug 8, 2023
1 parent 33de662 commit 6775a95
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 3 deletions.
20 changes: 17 additions & 3 deletions custom_components/wellbeing/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import asyncio
import logging
import socket
import json
from datetime import datetime, timedelta
from enum import Enum

Expand All @@ -14,6 +15,7 @@
from homeassistant.const import TEMP_CELSIUS, PERCENTAGE, CONCENTRATION_PARTS_PER_MILLION, \
CONCENTRATION_PARTS_PER_BILLION, CONCENTRATION_MICROGRAMS_PER_CUBIC_METER


TIMEOUT = 10
RETRIES = 3
CLIENT_ID = "ElxOneApp"
Expand All @@ -40,6 +42,10 @@

HEADERS = {"Content-type": "application/json; charset=UTF-8"}

class CustomComponent:
def get_translation(self, key):
return translations.get(key, key)

class Mode(str, Enum):
OFF = "PowerOff"
AUTO = "Auto"
Expand Down Expand Up @@ -240,14 +246,22 @@ def setup(self, data):

@property
def speed_range(self) -> tuple:
if self.model == "WELLA7":
## Electrolux Devices:
if self.model == "WELLA5":
return 1, 5
if self.model == "AX7":
if self.model == "WELLA7":
return 1, 5
if self.model == "PUREA9":
return 1, 9
if self.model == "WELLA5":


## AEG Devices:
if self.model == "AX5":
return 1, 5
if self.model == "AX7":
return 1, 5
if self.model == "AX9":
return 1, 9

return 0, 0

Expand Down
35 changes: 35 additions & 0 deletions custom_components/wellbeing/translations/de.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"config": {
"step": {
"user": {
"description": "Wenn Sie Hilfe bei der Konfiguration benötigen, schauen Sie hier: https://github.com/JohNan/homeassistant-wellbeing",
"data": {
"username": "Benutzername (E-Mail)",
"password": "Passwort"
}
},
"reauth_validate": {
"data": {
"password": "Passwort"
},
"description": "Geben Sie das Passwort für {username} ein.",
"title": "Account-Reauthentifizierung"
}
},
"error": {
"auth": "Benutzername oder Passwort falsch!"
},
"abort": {
"single_instance_allowed": "Nur eine einzige Instanz ist zulässig."
}
},
"options": {
"step": {
"user": {
"data": {
"scan_interval": "API-Aktualisierungsintervall (in Sekunden)"
}
}
}
}
}

0 comments on commit 6775a95

Please sign in to comment.