diff --git a/front/src/assets/integrations/cover/openweather.jpg b/front/src/assets/integrations/cover/openweather.jpg
new file mode 100644
index 0000000000..532ba72fd0
Binary files /dev/null and b/front/src/assets/integrations/cover/openweather.jpg differ
diff --git a/front/src/components/app.jsx b/front/src/components/app.jsx
index 66dc0bbc8a..bef17e4445 100644
--- a/front/src/components/app.jsx
+++ b/front/src/components/app.jsx
@@ -56,7 +56,7 @@ import SettingsGatewayOpenApi from '../routes/settings/settings-gateway-open-api
// Integrations
import TelegramPage from '../routes/integration/all/telegram';
import CaldavPage from '../routes/integration/all/caldav';
-import DarkSkyPage from '../routes/integration/all/darksky';
+import OpenWeatherPage from '../routes/integration/all/openweather';
import PhilipsHueSetupPage from '../routes/integration/all/philips-hue/setup-page';
import PhilipsHueDevicePage from '../routes/integration/all/philips-hue/device-page';
import ZwaveNodePage from '../routes/integration/all/zwave/node-page';
@@ -153,7 +153,7 @@ const AppRouter = connect(
-
+ (
{' '}
-
+
@@ -119,7 +119,7 @@ const WeatherBox = ({ children, ...props }) => (
fontSize: '30px'
}}
>
- {props.units === 'si' ? 'C' : 'F'}
+ {props.units === 'metric' ? 'C' : 'F'}
diff --git a/front/src/config/demo.json b/front/src/config/demo.json
index fb036fb165..42fb82beb7 100644
--- a/front/src/config/demo.json
+++ b/front/src/config/demo.json
@@ -169,7 +169,7 @@
"humidity": 0.99,
"pressure": 1005.09,
"datetime": "2019-05-09T04:27:57.000Z",
- "units": "si",
+ "units": "metric",
"wind_speed": 1.96,
"weather": "rain",
"house": {
diff --git a/front/src/config/i18n/en.json b/front/src/config/i18n/en.json
index 0bbdab4344..8499d2ef8d 100644
--- a/front/src/config/i18n/en.json
+++ b/front/src/config/i18n/en.json
@@ -183,9 +183,9 @@
"weather": {
"editHouseLabel": "Select a house. I will use its latitude/longitude to get the weather.",
"houseHasNoCoordinates": "Your house has no coordinates defined. Go to Gladys parameters to define the position of your house.",
- "serviceNotConfigured": "The DarkSky service is not configured. Please go to the 'Integrations' tab, and configure the DarkSky service.",
- "requestToThirdPartyFailed": "The request to DarkSKy API failed. Is your Gladys instance connected to the internet? Please go to the DarkSky configuration panel to troubleshoot this problem.",
- "clickHere": "Click here to access the DarkSky configuration panel.",
+ "serviceNotConfigured": "The OpenWeather service is not configured. Please go to the 'Integrations' tab, and configure the OpenWeather service.",
+ "requestToThirdPartyFailed": "The request to OpenWeather API failed. Is your Gladys instance connected to the internet? Please go to the OpenWeather configuration panel to troubleshoot this problem.",
+ "clickHere": "Click here to access the OpenWeather configuration panel.",
"unknownError": "We are unable to get the weather for this house. Did you define a house for this box?"
},
"devicesInRoom": {
@@ -398,13 +398,13 @@
"nodeAddedDescription": "Wait a few seconds while we get all of the information from this node..."
}
},
- "darkSky": {
- "title": "DarkSky",
+ "openWeather": {
+ "title": "OpenWeather API",
"description": "Get the weather in Gladys.",
- "introduction": "This integration helps you integrate with the DarkSky API to get the weather in Gladys.",
- "instructions": "You first need to create an account on the DarkSky API website: https://darksky.net/dev.",
+ "introduction": "This integration helps you integrate with OpenWeather API to get the weather in Gladys.",
+ "instructions": "You first need to create an account on OpenWeather API website: https://openweathermap.org/api.",
"apiKeyLabel": "Then, enter your API key here:",
- "apiKeyPlaceholder": "Enter DarkSky API key",
+ "apiKeyPlaceholder": "Enter OpenWeather API key",
"saveButton": "Save",
"instructionsToUse": "To use this integration, go to the dashboard and create a weather box."
},
diff --git a/front/src/config/i18n/fr.json b/front/src/config/i18n/fr.json
index 5859705e2b..cae91739a9 100644
--- a/front/src/config/i18n/fr.json
+++ b/front/src/config/i18n/fr.json
@@ -183,9 +183,9 @@
"weather": {
"editHouseLabel": "Sélectionnez une maison. J'utiliserais les latitude/longitude pour obtenir la météo.",
"houseHasNoCoordinates": "Les coordonnées de votre maison ne sont pas définies. Accédez aux paramètres Gladys pour définir la position de votre maison.",
- "serviceNotConfigured": "Le service DarkSky n'est pas configuré. Veuillez accéder à l'onglet «Intégrations» et configurer le service DarkSky.",
- "requestToThirdPartyFailed": "La requête à l'API DarkSKy a échouée. Votre instance Gladys est-elle connectée à Internet? Veuillez vous rendre dans le panneau de configuration de DarkSky pour résoudre ce problème.",
- "clickHere": "Cliquez ici pour accéder au panneau de configuration de DarkSky.",
+ "serviceNotConfigured": "Le service OpenWeather n'est pas configuré. Veuillez accéder à l'onglet «Intégrations» et configurer le service OpenWeather.",
+ "requestToThirdPartyFailed": "La requête à l'API OpenWeather a échouée. Votre instance Gladys est-elle connectée à Internet? Veuillez vous rendre dans le panneau de configuration de OpenWeather pour résoudre ce problème.",
+ "clickHere": "Cliquez ici pour accéder au panneau de configuration de OpenWeather.",
"unknownError": "Nous ne pouvons pas obtenir la météo pour cette maison. Avez-vous défini une maison pour cette box ?"
},
"devicesInRoom": {
@@ -442,13 +442,13 @@
"nodeAddedDescription": "Attendez quelques secondes pendant que nous obtenons toutes les informations de ce nœud..."
}
},
- "darkSky": {
- "title": "DarkSky",
+ "openWeather": {
+ "title": "API OpenWeather",
"description": "Récupérer la météo dans Gladys.",
- "introduction": "Cette intégration vous aide à intégrer l'API DarkSky pour obtenir la météo dans Gladys.",
- "instructions": "Vous devez d'abord créer un compte sur le site Web de l'API DarkSky : https://darksky.net/dev.",
+ "introduction": "Cette intégration vous aide à intégrer l'API OpenWeather pour obtenir la météo dans Gladys.",
+ "instructions": "Vous devez d'abord créer un compte sur le site Web de l'API d'OpenWeather : https://openweathermap.org/api.",
"apiKeyLabel": "Saisissez ensuite votre clé API ici :",
- "apiKeyPlaceholder": "Entrer la clé API DarkSky",
+ "apiKeyPlaceholder": "Entrer la clé API OpenWeather",
"saveButton": "Sauvegarder",
"instructionsToUse": "Pour utiliser cette intégration, accédez au tableau de bord et créez une box météo."
},
diff --git a/front/src/config/integrations/weathers.json b/front/src/config/integrations/weathers.json
index 71ba2daef0..3f515ba90a 100644
--- a/front/src/config/integrations/weathers.json
+++ b/front/src/config/integrations/weathers.json
@@ -1,6 +1,6 @@
[
{
- "key": "darkSky",
- "img": "/assets/integrations/cover/darksky.jpg"
+ "key": "openWeather",
+ "img": "/assets/integrations/cover/openweather.jpg"
}
]
diff --git a/front/src/routes/integration/all/darksky/actions.js b/front/src/routes/integration/all/darksky/actions.js
deleted file mode 100644
index a192b87cb5..0000000000
--- a/front/src/routes/integration/all/darksky/actions.js
+++ /dev/null
@@ -1,51 +0,0 @@
-import { RequestStatus } from '../../../../utils/consts';
-
-const actions = store => ({
- updateApiKey(state, e) {
- store.setState({
- darkSkyApiKey: e.target.value
- });
- },
- async getApiKey(state) {
- store.setState({
- darkskyGetApiKeyStatus: RequestStatus.Getting
- });
- try {
- const variable = await state.httpClient.get('/api/v1/service/darksky/variable/DARKSKY_API_KEY');
- store.setState({
- darkSkyApiKey: variable.value,
- darkskyGetApiKeyStatus: RequestStatus.Success
- });
- } catch (e) {
- store.setState({
- darkskyGetApiKeyStatus: RequestStatus.Error
- });
- }
- },
- async saveApiKey(state, e) {
- e.preventDefault();
- store.setState({
- darkskySaveApiKeyStatus: RequestStatus.Getting
- });
- try {
- store.setState({
- darkSkyApiKey: state.darkSkyApiKey.trim()
- });
- // save api key
- await state.httpClient.post('/api/v1/service/darksky/variable/DARKSKY_API_KEY', {
- value: state.darkSkyApiKey.trim()
- });
- // start service
- await state.httpClient.post('/api/v1/service/darksky/start');
- store.setState({
- darkskySaveApiKeyStatus: RequestStatus.Success
- });
- } catch (e) {
- store.setState({
- darkskySaveApiKeyStatus: RequestStatus.Error
- });
- }
- }
-});
-
-export default actions;
diff --git a/front/src/routes/integration/all/darksky/index.js b/front/src/routes/integration/all/darksky/index.js
deleted file mode 100644
index e7f34e4355..0000000000
--- a/front/src/routes/integration/all/darksky/index.js
+++ /dev/null
@@ -1,20 +0,0 @@
-import { Component } from 'preact';
-import { connect } from 'unistore/preact';
-import actions from './actions';
-import DarkSkyPage from './DarkSky';
-import { RequestStatus } from '../../../../utils/consts';
-
-@connect('user,darkSkyApiKey,darkskySaveApiKeyStatus,darkskyGetApiKeyStatus', actions)
-class TelegramIntegration extends Component {
- componentWillMount() {
- this.props.getApiKey();
- }
-
- render(props, {}) {
- const loading =
- props.darkskySaveApiKeyStatus === RequestStatus.Getting || props.darkskyGetApiKeyStatus === RequestStatus.Getting;
- return ;
- }
-}
-
-export default TelegramIntegration;
diff --git a/front/src/routes/integration/all/darksky/DarkSky.jsx b/front/src/routes/integration/all/openweather/OpenWeather.jsx
similarity index 77%
rename from front/src/routes/integration/all/darksky/DarkSky.jsx
rename to front/src/routes/integration/all/openweather/OpenWeather.jsx
index 82dcb4e9a9..388ad513f8 100644
--- a/front/src/routes/integration/all/darksky/DarkSky.jsx
+++ b/front/src/routes/integration/all/openweather/OpenWeather.jsx
@@ -1,7 +1,7 @@
import { Text, MarkupText, Localizer } from 'preact-i18n';
import cx from 'classnames';
-const DarkSkyPage = ({ children, ...props }) => (
+const OpenWeatherPage = ({ children, ...props }) => (