Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Netatmo integration #1951

Merged
merged 65 commits into from
Jan 30, 2024
Merged
Show file tree
Hide file tree
Changes from 42 commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
79e0b29
Netatmo integration frontend & constants
Terdious Nov 25, 2023
22669de
Server with events and access_token connection
Terdious Nov 26, 2023
fc649d1
Refactor front connection access_token
Terdious Nov 26, 2023
172774c
front refactoring, improvement of status feedback and i18n update
Terdious Nov 28, 2023
6f50ca2
refactor server + eslint + first tests
Terdious Nov 28, 2023
79c0401
Front prettier
Terdious Nov 28, 2023
8c3a62a
Tests connect.js
Terdious Nov 28, 2023
dbfec6e
Continu Tests : index - mock - connect - disconnect - init - controller
Terdious Nov 29, 2023
fe389eb
Continuation of tests and related modifications
Terdious Nov 29, 2023
bde9721
fix error tests with 'sinon.restore' and 'spy.restore'
Terdious Nov 30, 2023
62648eb
fix eslint + prettier + tests
Terdious Nov 30, 2023
090612a
fix prettier front
Terdious Nov 30, 2023
a0a2692
cleaning and adding discovery/configuration/viewing/control of devices
Terdious Dec 7, 2023
7d50955
Merge branch 'master' into netatmo-integration
Terdious Dec 7, 2023
aca1325
following first returns fix remarks and errors
Terdious Dec 12, 2023
0e7a10e
Merge branch 'master' into netatmo-integration
Terdious Dec 12, 2023
06ab203
front change following the remark of the 1st test. Simplifying the co…
Terdious Dec 16, 2023
02b365b
server changes following the remarks of the 1st test. Modification of…
Terdious Dec 16, 2023
eb2f1e5
forgetting utils/constants
Terdious Dec 16, 2023
551db92
last add front and server
Terdious Dec 16, 2023
236d42f
Merge branch 'master' into netatmo-integration
Terdious Dec 18, 2023
d57e1b1
refactor: modify loadThermostat code and i18n
Terdious Dec 18, 2023
390a426
refactor: clean-up of the global front
Terdious Dec 18, 2023
1a5ffff
fix: prettier + eslint (front)
Terdious Dec 18, 2023
561ee89
refactor (front): deletion of unused translations, addition of unsupp…
Terdious Dec 18, 2023
fddb62b
refactor (server): adding automation of scopes, adding unsupported de…
Terdious Dec 18, 2023
85d8436
refactor: forgotten deletions i18n
Terdious Dec 18, 2023
54ebeac
test: modifications following server code changed
Terdious Dec 18, 2023
3f469a1
test: continuation of test corrections
Terdious Dec 18, 2023
9f30815
test: continuation of tests and server code fixes following completio…
Terdious Dec 19, 2023
7e4c5ac
fix: tests
Terdious Dec 20, 2023
7e02380
fix: tests
Terdious Dec 20, 2023
77ffbcb
Merge branch 'master' into netatmo-integration
Terdious Dec 20, 2023
13c8aa1
tests: continuation of test writing
Terdious Dec 21, 2023
656d9bc
fix: tests prettier and increase coverage
Terdious Dec 21, 2023
8483783
test: improvement of tests with interval and taking into account test…
Terdious Dec 21, 2023
8ac9168
fix: test on errors Timeout exceeded other integration
Terdious Dec 21, 2023
a690569
Merge branch 'master' into netatmo-integration
Terdious Jan 8, 2024
1ffe9b6
refactor: added German translate
Terdious Jan 8, 2024
6ae21f7
refactor: modifying links to sites in the correct language
Terdious Jan 8, 2024
7e2c588
Merge branch 'master' into netatmo-integration
Terdious Jan 8, 2024
9c84b45
Merge branch 'master' into netatmo-integration
Terdious Jan 8, 2024
7335612
Merge branch 'master' into netatmo-integration
Terdious Jan 11, 2024
1efb04d
refactor: first fixes server code
Terdious Jan 11, 2024
8e8927c
refactor: first fixes front
Terdious Jan 11, 2024
a493d6c
refactor-fix: front corrections
Terdious Jan 14, 2024
d46e4a0
refactor-fix: server corrections + tests
Terdious Jan 15, 2024
7dc7183
Merge branch 'master' into netatmo-integration
Terdious Jan 15, 2024
6e322b2
refactor: add front message update values
Terdious Jan 15, 2024
cb7f7e6
refactor: Update Netatmo setup page styles and text display - using t…
Terdious Jan 16, 2024
1238b04
refactor: Update Netatmo device discovery messages
Terdious Jan 16, 2024
83fd5a3
refactor: Add StateConnection component to DeviceTab
Terdious Jan 16, 2024
2169e89
refactor+fix: Fix console.log statements and optimize devicePage and …
Terdious Jan 16, 2024
e64b32b
fix: Fix syntax error in DeviceTab.jsx
Terdious Jan 16, 2024
defd0e4
refactor+fix: Remove console.log statements and add/modify alert mess…
Terdious Jan 17, 2024
3085995
refactor: Update Netatmo device and discover page texts + deleted tex…
Terdious Jan 18, 2024
fd519a7
refactor: Netatmo device features update method
Terdious Jan 27, 2024
10b3502
refactor: Update and Tests NATherm1 and NAPlug features
Terdious Jan 27, 2024
3b3c536
refactor: NetatmoDeviceBox component and style.css
Terdious Jan 29, 2024
8604878
fix: Following the review add bluebird dependency and update device p…
Terdious Jan 29, 2024
b6339bb
Merge branch 'master' into netatmo-integration
Terdious Jan 29, 2024
dcab1b2
refactor: Update concurrency in refreshNetatmoValues function
Terdious Jan 29, 2024
9030ba3
refactor: coverage Netatmo devices update functions
Terdious Jan 29, 2024
c562320
fake: push with error to relaunch codecov
Terdious Jan 30, 2024
1bd23da
fake: push without error to relaunch codecov
Terdious Jan 30, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions front/src/components/app.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,11 @@ import TuyaEditPage from '../routes/integration/all/tuya/edit-page';
import TuyaSetupPage from '../routes/integration/all/tuya/setup-page';
import TuyaDiscoverPage from '../routes/integration/all/tuya/discover-page';

// Netatmo integration
import NetatmoPage from '../routes/integration/all/netatmo/device-page';
import NetatmoSetupPage from '../routes/integration/all/netatmo/setup-page';
import NetatmoDiscoverPage from '../routes/integration/all/netatmo/discover-page';

// Sonos integration
import SonosDevicePage from '../routes/integration/all/sonos/device-page';
import SonosDiscoveryPage from '../routes/integration/all/sonos/discover-page';
Expand Down Expand Up @@ -279,6 +284,10 @@ const AppRouter = connect(
<TuyaDiscoverPage path="/dashboard/integration/device/tuya/discover" />
<TuyaSetupPage path="/dashboard/integration/device/tuya/setup" />

<NetatmoPage path="/dashboard/integration/device/netatmo" />
<NetatmoDiscoverPage path="/dashboard/integration/device/netatmo/discover" />
<NetatmoSetupPage path="/dashboard/integration/device/netatmo/setup" />

<SonosDevicePage path="/dashboard/integration/device/sonos" />
<SonosDiscoveryPage path="/dashboard/integration/device/sonos/discover" />

Expand Down
82 changes: 82 additions & 0 deletions front/src/config/i18n/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -509,6 +509,88 @@
"rotation18O": "180°",
"rotation27O": "270°"
},
"netatmo": {
"title": "Netatmo",
"description": "Netatmo-Geräte steuern",
"deviceTab": "Geräte",
"discoverTab": "Netatmo-Entdeckung",
"setupTab": "Konfiguration",
"documentation": "Netatmo-Dokumentation",
"discoverDeviceDescr": "Netatmo-Geräte automatisch scannen",
"unmanagedModelButton": "Nicht unterstütztes oder nicht verfügbares Modell",
"status": {
"notConnected": "Gladys konnte keine Verbindung zum Netatmo-Konto herstellen, bitte überprüfen Sie Ihre Anmeldeinformationen auf der ",
"setupPageLink": "Netatmo-Konfigurationsseite.",
"connecting": "Verbindung zu Ihrem Netatmo-Konto wird hergestellt...",
"connect": "Gladys ist mit Netatmo verbunden",
"disconnect": "Gladys ist nicht mit Netatmo verbunden",
"notConfigured": "Der Netatmo-Dienst ist nicht konfiguriert"
},
"device": {
"title": "Netatmo-Geräte in Gladys",
"noDeviceFound": "Noch keine Netatmo-Geräte hinzugefügt.",
"sidLabel": "Netatmo-SID des Geräts",
"nameLabel": "Gerätename",
"namePlaceholder": "Geben Sie den Namen Ihres Geräts ein",
"modelLabel": "Modell",
"roomLabel": "Raum",
"featuresLabel": "Funktionen",
"saveButton": "Speichern",
"updateButton": "Aktualisieren",
"editButton": "Bearbeiten",
"deleteButton": "Löschen",
"unmanagedModelButton": "Nicht unterstütztes Modell",
"noValueReceived": "Kein Wert empfangen.",
"firmwareRevisionLabel": "Firmware: ",
"connectedPlugLabel": "Mit der Brücke verbunden",
"roomNetatmoApiLabel": "Raum in der Netatmo-API"
},
"discover": {
"title": "Ihre mit Gladys kompatiblen Netatmo-Geräte",
"description": "Ihre Netatmo-Geräte müssen zuerst zu Ihrem Netatmo-Konto hinzugefügt werden, bevor sie zu Gladys hinzugefügt werden können, das derzeit nur Thermostate unterstützt, die mit ihrem Plug verbunden sind. Die erste Entdeckung erfolgt automatisch. Drücken Sie 'Aktualisieren', wenn Sie die neuen Funktionen Ihrer Geräte abrufen möchten.",
"descriptionCompatibility": "Für alle Anfragen zur Hinzufügung von Geräten und/oder Funktionen, besuchen Sie bitte das <a href=\"https://en-community.gladysassistant.com/c/feature-requests\" target=\"_blank\" rel=\"noopener noreferrer\">Gladys Assistant Forum - Kategorie \"Funktionsanfragen\"</a>.",
"noDeviceFound": "Keine Netatmo-Geräte gefunden. Haben Sie alle Schritte der Dokumentation befolgt, um Ihre Geräte in der Netatmo-API zu registrieren?",
"alreadyCreatedButton": "Bereits erstellt",
"scan": "Scannen",
"refresh": "Aktualisieren"
},
"setup": {
"title": "Netatmo-Konfiguration",
"clientIdLabel": "Kunden-ID",
"clientIdPlaceholder": "Kunden-ID von My Apps in Netatmo Connect",
"clientSecretLabel": "Kundengeheimnis",
"clientSecretPlaceholder": "Kundengeheimnis von My Apps in Netatmo Connect",
"saveLabel": "Konfiguration speichern",
"connectLabel": "und Verbindung zu Netatmo",
"reconnectLabel": "und erneute Verbindung zu Netatmo",
"disconnectLabel": "Trennen",
"disconnectInformationLabel": "(Entfernt Gladys-Zugriff)",
"description": "Sie können Gladys mit Ihrem Netatmo-Konto verbinden, um die zugehörigen Geräte zu steuern.",
"descriptionCreateAccount": "Sie müssen ein Konto auf <a href=\"https://auth.netatmo.com/de-de/access/login\" target=\"_blank\" rel=\"noopener noreferrer\">Netatmo Connect</a> erstellen.",
"descriptionCreateProject": "Danach müssen Sie eine \"Anwendung\" in Ihrem Netatmo-Entwicklerkonto über das Menü <a href=\"https://dev.netatmo.com/apps/\" target=\"_blank\" rel=\"noopener noreferrer\">Meine App</a> erstellen.",
"descriptionGetKeys": "Dann haben Sie Zugriff auf zwei Schlüssel: \"Kunden-ID\" und \"Kundengeheimnis\", die Sie unten kopieren können.",
"descriptionScopeInformation": "Wenn Sie Gladys mit Ihrer dedizierten Netatmo-App verbinden, erteilen Sie ihr die Berechtigung, auf Ihre Daten zum Lesen und Schreiben zuzugreifen (genannt Scopes \"read\" und \"write\"). Sie müssen nichts konfigurieren, diese Scopes sind automatisch integriert und werden Ihnen bei der Verbindungsanfrage angezeigt (siehe Dokumentation bei Bedarf). Da Gladys lokal installiert ist, werden keine dieser Daten preisgegeben.",
"titleAdditionalInformation": "Weitere Informationen über die Funktionsweise der \"Energy\"-API:",
"descriptionAdditionalInformation": "Temperaturbefehle werden auf Raumniveau ausgeführt. Daher sind beide Informationen als Funktionen für mehr Kontrolle verfügbar. Wenn Sie andere Temperatursensoren im gleichen Raum wie Ihr Thermostat haben, wird die Durchschnittstemperatur dieses Raums berücksichtigt, um den Heizungssteuerschalter auszulösen.",
"errorConnecting": {
"other_error": "Fehler bei der Autorisierung. Sie können den Fehler in der Konsole Ihres Browsers mit einem Rechtsklick untersuchen. Wenn der Fehler weiterhin besteht, posten Sie bitte die Protokolle im Forum.",
"access_denied": "Autorisierung abgelehnt, bitte versuchen Sie es erneut und akzeptieren Sie den Zugriff auf Ihre Daten.",
"invalid_client": "Ungültige Kunden-ID. Bitte überprüfen Sie Ihre Netatmo-Kontoinformationen und dass das Konto nicht gesperrt oder deaktiviert ist <a href=\"https://dev.netatmo.com/apps/\" target=\"_blank\" rel=\"noopener noreferrer\">Meine App</a>.",
"get_access_token_fail": "Falsche Informationen eingegeben oder Konto deaktiviert. Bitte überprüfen Sie Ihre Netatmo-Kontoinformationen und dass das Konto nicht gesperrt oder deaktiviert ist <a href=\"https://dev.netatmo.com/apps/\" target=\"_blank\" rel=\"noopener noreferrer\">Meine App</a>."
},
"notConfigured": "Der Netatmo-Dienst ist nicht konfiguriert",
"connecting": "Konfiguration gespeichert. Verbindung zu Ihrem Netatmo-Konto wird hergestellt...",
"processingToken": "Verbindung zu Ihrem Netatmo-Konto... Zugriffstoken wird abgerufen.",
"connect": "Gladys ist mit Netatmo verbunden",
"disconnect": "Gladys ist nicht mit Netatmo verbunden",
"connectionError": "Fehler bei der Verbindung, bitte überprüfen Sie Ihre Konfiguration."
},
"error": {
"defaultError": "Ein Fehler ist bei der Registrierung des Geräts aufgetreten.",
"defaultDeletionError": "Ein Fehler ist bei der Löschung des Geräts aufgetreten.",
"conflictError": "Das aktuelle Gerät ist bereits in Gladys."
}
},
"tasmota": {
"title": "Tasmota",
"description": "Steuere deine Tasmota-Geräte über HTTP oder MQTT.",
Expand Down
82 changes: 82 additions & 0 deletions front/src/config/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -509,6 +509,88 @@
"rotation18O": "180°",
"rotation27O": "270°"
},
"netatmo": {
"title": "Netatmo",
"description": "Control Netatmo equipment",
"deviceTab": "Devices",
"discoverTab": "Netatmo Discovery",
"setupTab": "Setup",
"documentation": "Netatmo Documentation",
"discoverDeviceDescr": "Automatically scan Netatmo devices",
"unmanagedModelButton": "Model not supported or unavailable",
"status": {
"notConnected": "Gladys failed to connect to the Netatmo account, please verify your credentials on the ",
"setupPageLink": "Netatmo Setup Page.",
"connecting": "Connecting to your Netatmo account...",
"connect": "Gladys is connected to Netatmo",
"disconnect": "Gladys is not connected to Netatmo",
"notConfigured": "The Netatmo service is not configured"
},
"device": {
"title": "Netatmo Devices in Gladys",
"noDeviceFound": "No Netatmo devices have been added yet.",
"sidLabel": "Netatmo device SID",
"nameLabel": "Device name",
"namePlaceholder": "Enter your device name",
"modelLabel": "Model",
"roomLabel": "Room",
"featuresLabel": "Features",
"saveButton": "Save",
"updateButton": "Update",
"editButton": "Edit",
"deleteButton": "Delete",
"unmanagedModelButton": "Unsupported model",
"noValueReceived": "No value received.",
"firmwareRevisionLabel": "Firmware: ",
"connectedPlugLabel": "Connected to bridge",
"roomNetatmoApiLabel": "Room in Netatmo API"
},
"discover": {
"title": "Your Netatmo Devices Compatible with Gladys",
"description": "Your Netatmo devices must be added to your Netatmo account before being added to Gladys, which currently only supports Thermostats associated with their Plug. The first discovery is done automatically. Press 'Refresh' if you want to retrieve new features of your devices.",
"descriptionCompatibility": "For any requests to add devices and/or features, please visit the <a href=\"https://en-community.gladysassistant.com/c/feature-requests\" target=\"_blank\" rel=\"noopener noreferrer\">Gladys Assistant Forum - Feature Requests Category</a>.",
"noDeviceFound": "No Netatmo devices were found. If you own a Netatmo Thermostat, have you completed all the steps in the documentation to register your devices on the Netatmo API?",
"alreadyCreatedButton": "Already Created",
"scan": "Scan",
"refresh": "Refresh"
},
"setup": {
"title": "Netatmo Setup",
"clientIdLabel": "Client ID",
"clientIdPlaceholder": "Client ID from My Apps in Netatmo Connect",
"clientSecretLabel": "Client Secret",
"clientSecretPlaceholder": "Client secret from My Apps in Netatmo Connect",
"saveLabel": "Save Configuration",
"connectLabel": "and connect to Netatmo",
"reconnectLabel": "and reconnect to Netatmo",
"disconnectLabel": "Disconnect",
"disconnectInformationLabel": "(Removes Gladys's Access)",
"description": "You can connect Gladys to your Netatmo account to control the associated devices.",
"descriptionCreateAccount": "You need to create an account on <a href=\"https://auth.netatmo.com/en-us/access/login\" target=\"_blank\" rel=\"noopener noreferrer\">Netatmo Connect</a>.",
"descriptionCreateProject": "You will then need to create an \"application\" in your Netatmo developer account via the <a href=\"https://dev.netatmo.com/apps/\" target=\"_blank\" rel=\"noopener noreferrer\">My App</a>.",
"descriptionGetKeys": "You will then have access to two keys: \"client ID\" and \"client secret\" to copy below.",
"descriptionScopeInformation": "When you connect Gladys to your dedicated Netatmo App, you grant it permission to access your data in read and write modes (referred to as \"read\" and \"write\" scopes). You don't have to configure anything, these scopes are automatically integrated and will be presented to you during the connection request (see documentation if needed). Of course, since Gladys is installed locally, none of these data is exposed.",
"titleAdditionalInformation": "Additional Information on the Operation of the \"Energy\" API:",
"descriptionAdditionalInformation": "Temperature commands are performed at the room level. Therefore, both pieces of information are available as features for more control. If you have other temperature sensors in the same room as your Thermostat, it's the average temperature of that room that will be considered to trigger the heating control switch.",
"errorConnecting": {
"other_error": "Error during authorization. You can inspect the error in your browser's console with a right click. If the error persists, please post the logs on the forum.",
"access_denied": "Authorization declined, please try again and accept the request for access to your data.",
"invalid_client": "Invalid client ID. Please verify your Netatmo account information and that the account is not banned or disabled <a href=\"https://dev.netatmo.com/apps/\" target=\"_blank\" rel=\"noopener noreferrer\">My App</a>.",
"get_access_token_fail": "Incorrect information entered or account disabled. Please check your Netatmo account information and that the account is not banned or disabled <a href=\"https://dev.netatmo.com/apps/\" target=\"_blank\" rel=\"noopener noreferrer\">My App</a>."
},
"notConfigured": "The Netatmo service is not configured",
"connecting": "Configuration saved. Connecting to your Netatmo account...",
"processingToken": "Connecting to your Netatmo account... Retrieving access token.",
"connect": "Gladys is connected to Netatmo",
"disconnect": "Gladys is not connected to Netatmo",
"connectionError": "Error during connection, please check your configuration."
},
"error": {
"defaultError": "An error occurred while registering the device.",
"defaultDeletionError": "An error occurred while deleting the device.",
"conflictError": "The current device is already in Gladys."
}
},
"tasmota": {
"title": "Tasmota",
"description": "Control your Tasmota devices in HTTP or MQTT.",
Expand Down
Loading
Loading