diff --git a/gulpfile.js b/gulpfile.js index 34bd08c..01401de 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -12,6 +12,8 @@ const gulpHelper = require('@iobroker/vis-2-widgets-react-dev/gulpHelper'); gulpHelper.gulpTasks(gulp, adapterName, __dirname, `${__dirname}/src-widgets/`, [ `${__dirname}/src-widgets/build/static/js/*echarts-for-react_lib_core_js-node_modules_echarts_core*.*`, + `${__dirname}/src-widgets/build/static/js/*spectrum_color_dist_import_mjs*.*`, + `${__dirname}/src-widgets/build/static/js/*uiw_react-color-shade-slider*.*`, ]); gulp.task('default', gulp.series('widget-build')); \ No newline at end of file diff --git a/io-package.json b/io-package.json index 1f2b5b9..2e3038e 100644 --- a/io-package.json +++ b/io-package.json @@ -136,6 +136,7 @@ "Switches", "Blinds", "Clock", + "RGBLight", "SimpleState", "ViewInWidget", "Camera", diff --git a/src-widgets/package.json b/src-widgets/package.json index 55b08fe..bc2dd8b 100644 --- a/src-widgets/package.json +++ b/src-widgets/package.json @@ -8,7 +8,7 @@ "@craco/craco": "^7.1.0", "@emotion/react": "^11.11.1", "@emotion/styled": "^11.11.0", - "@iobroker/adapter-react-v5": "^4.4.7", + "@iobroker/adapter-react-v5": "^4.5.0", "@iobroker/vis-2-widgets-react-dev": "^0.4.6", "@mui/icons-material": "^5.14.3", "@mui/material": "^5.14.5", @@ -42,7 +42,7 @@ "react-icons": "^4.10.1", "react-leaflet": "^4.2.1", "react-scripts": "^5.0.1", - "sass": "^1.65.1", + "sass": "^1.66.0", "uuid": "^9.0.0" }, "scripts": { @@ -64,4 +64,4 @@ "not ie <= 11", "not op_mini all" ] -} +} \ No newline at end of file diff --git a/src-widgets/src/RGBLight.jsx b/src-widgets/src/RGBLight.jsx index ab017f3..74f1d4a 100644 --- a/src-widgets/src/RGBLight.jsx +++ b/src-widgets/src/RGBLight.jsx @@ -35,6 +35,8 @@ const styles = () => ({ const stateRoles = { 'switch.light': 'switch', + switch: 'switch', + 'level.brightness': 'brightness', 'level.dimmer': 'brightness', 'level.color.red': 'red', 'level.color.green': 'green', @@ -70,7 +72,7 @@ const loadStates = async (field, data, changeData, socket) => { class RGBLight extends Generic { constructor(props) { super(props); - this.state.dialog = true; + this.state.dialog = false; this.state.objects = {}; this.state.colorTemperatures = []; this.sketch = false; @@ -342,11 +344,12 @@ class RGBLight extends Generic { renderSwitch() { return this.state.objects.switch &&
+ {Generic.t('Off')} this.setId('switch', e.target.checked)} /> - {Generic.getText(this.state.objects?.switch?.common?.name)} + {Generic.t('On')}
; } @@ -455,7 +458,10 @@ class RGBLight extends Generic { } renderDialog() { - return this.setState({ dialog: false })}> + if (!this.state.dialog) { + return null; + } + return this.setState({ dialog: false })}> {this.state.rxData.widgetTitle}
diff --git a/src-widgets/src/i18n/de.json b/src-widgets/src/i18n/de.json index 2c1e79b..c7829b1 100644 --- a/src-widgets/src/i18n/de.json +++ b/src-widgets/src/i18n/de.json @@ -301,5 +301,7 @@ "vacuumCleaner": "Staubsauger", "image": "Bild", "Brightness": "Helligkeit", - "Color temperature": "Farbtemperatur" + "Color temperature": "Farbtemperatur", + "Close": "Schließen", + "Switch color picker": "Farbauswahl wechseln" } \ No newline at end of file diff --git a/src-widgets/src/i18n/es.json b/src-widgets/src/i18n/es.json index 0ca292a..b8c4744 100644 --- a/src-widgets/src/i18n/es.json +++ b/src-widgets/src/i18n/es.json @@ -301,5 +301,7 @@ "vacuumCleaner": "aspiradora", "image": "Imagen", "Brightness": "Brillo", - "Color temperature": "Temperatura del color" + "Color temperature": "Temperatura del color", + "Close": "Cerca", + "Switch color picker": "Cambiar selector de color" } \ No newline at end of file diff --git a/src-widgets/src/i18n/fr.json b/src-widgets/src/i18n/fr.json index f977b41..3f1e6f1 100644 --- a/src-widgets/src/i18n/fr.json +++ b/src-widgets/src/i18n/fr.json @@ -301,5 +301,7 @@ "vacuumCleaner": "aspirateur", "image": "Image", "Brightness": "Luminosité", - "Color temperature": "Température de couleur" + "Color temperature": "Température de couleur", + "Close": "Fermer", + "Switch color picker": "Changer de sélecteur de couleur" } \ No newline at end of file diff --git a/src-widgets/src/i18n/it.json b/src-widgets/src/i18n/it.json index 99cd17e..335232e 100644 --- a/src-widgets/src/i18n/it.json +++ b/src-widgets/src/i18n/it.json @@ -301,5 +301,7 @@ "vacuumCleaner": "Aspirapolvere", "image": "Immagine", "Brightness": "Luminosità", - "Color temperature": "Temperatura di colore" + "Color temperature": "Temperatura di colore", + "Close": "Vicino", + "Switch color picker": "Cambia selettore colore" } \ No newline at end of file diff --git a/src-widgets/src/i18n/nl.json b/src-widgets/src/i18n/nl.json index a68a9d2..4939970 100644 --- a/src-widgets/src/i18n/nl.json +++ b/src-widgets/src/i18n/nl.json @@ -301,5 +301,7 @@ "vacuumCleaner": "Stofzuiger", "image": "Afbeelding", "Brightness": "Helderheid", - "Color temperature": "Kleurtemperatuur" + "Color temperature": "Kleurtemperatuur", + "Close": "Dichtbij", + "Switch color picker": "Wissel van kleurenkiezer" } \ No newline at end of file diff --git a/src-widgets/src/i18n/pl.json b/src-widgets/src/i18n/pl.json index 5ffbb45..887dedd 100644 --- a/src-widgets/src/i18n/pl.json +++ b/src-widgets/src/i18n/pl.json @@ -301,5 +301,7 @@ "vacuumCleaner": "Odkurzacz", "image": "Obraz", "Brightness": "Jasność", - "Color temperature": "Temperatura koloru" + "Color temperature": "Temperatura koloru", + "Close": "Zamknąć", + "Switch color picker": "Przełącz próbnik kolorów" } \ No newline at end of file diff --git a/src-widgets/src/i18n/pt.json b/src-widgets/src/i18n/pt.json index 3eda73f..d743794 100644 --- a/src-widgets/src/i18n/pt.json +++ b/src-widgets/src/i18n/pt.json @@ -301,5 +301,7 @@ "vacuumCleaner": "Aspirador de pó", "image": "Imagem", "Brightness": "Brilho", - "Color temperature": "Temperatura de cor" + "Color temperature": "Temperatura de cor", + "Close": "Fechar", + "Switch color picker": "Alternar seletor de cores" } \ No newline at end of file diff --git a/src-widgets/src/i18n/ru.json b/src-widgets/src/i18n/ru.json index f8cc366..9d3097a 100644 --- a/src-widgets/src/i18n/ru.json +++ b/src-widgets/src/i18n/ru.json @@ -301,5 +301,7 @@ "vacuumCleaner": "Пылесос", "image": "Изображение", "Brightness": "Яркость", - "Color temperature": "Цветовая температура" + "Color temperature": "Цветовая температура", + "Close": "Закрывать", + "Switch color picker": "Переключить палитру цветов" } \ No newline at end of file diff --git a/src-widgets/src/i18n/uk.json b/src-widgets/src/i18n/uk.json index 0eeb561..4cacb2f 100644 --- a/src-widgets/src/i18n/uk.json +++ b/src-widgets/src/i18n/uk.json @@ -301,5 +301,7 @@ "vacuumCleaner": "Пилосос", "image": "Зображення", "Brightness": "Яскравість", - "Color temperature": "Колірна температура" + "Color temperature": "Колірна температура", + "Close": "Закрити", + "Switch color picker": "Змінити вибір кольору" } \ No newline at end of file diff --git a/src-widgets/src/i18n/zh-cn.json b/src-widgets/src/i18n/zh-cn.json index 3d269bd..75a9773 100644 --- a/src-widgets/src/i18n/zh-cn.json +++ b/src-widgets/src/i18n/zh-cn.json @@ -301,5 +301,7 @@ "vacuumCleaner": "吸尘器", "image": "图像", "Brightness": "亮度", - "Color temperature": "色温" + "Color temperature": "色温", + "Close": "关闭", + "Switch color picker": "切换颜色选择器" } \ No newline at end of file