@iobroker/adapter-react-v5 7.4.17 → 7.4.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/Components/FileBrowser.d.ts +1 -0
- package/build/Components/FileBrowser.js +10 -7
- package/build/Components/FileBrowser.js.map +1 -1
- package/build/Components/IconDeviceType.d.ts +1 -1
- package/build/Components/IconDeviceType.js +2 -1
- package/build/Components/IconDeviceType.js.map +1 -1
- package/build/Components/ObjectBrowser.d.ts +1 -1
- package/build/Components/ObjectBrowser.js +10 -2
- package/build/Components/ObjectBrowser.js.map +1 -1
- package/build/GenericApp.js +1 -1
- package/build/GenericApp.js.map +1 -1
- package/build/i18n/de.json +1 -1
- package/build/i18n/en.json +1 -1
- package/build/i18n/es.json +1 -1
- package/build/i18n/fr.json +1 -1
- package/build/i18n/it.json +1 -1
- package/build/i18n/nl.json +1 -1
- package/build/i18n/pl.json +1 -1
- package/build/i18n/pt.json +1 -1
- package/build/i18n/ru.json +1 -1
- package/build/i18n/uk.json +1 -1
- package/build/i18n/zh-cn.json +1 -1
- package/i18n/de.json +1 -1
- package/i18n/en.json +1 -1
- package/i18n/es.json +1 -1
- package/i18n/fr.json +1 -1
- package/i18n/it.json +1 -1
- package/i18n/nl.json +1 -1
- package/i18n/pl.json +1 -1
- package/i18n/pt.json +1 -1
- package/i18n/ru.json +1 -1
- package/i18n/uk.json +1 -1
- package/i18n/zh-cn.json +1 -1
- package/package.json +3 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { type IconProps } from './Icon';
|
|
3
|
-
declare const deviceTypes: readonly ["unknown", "airCondition", "blind", "blindButtons", "button", "buttonSensor", "camera", "chart", "cie", "ct", "dimmer", "door", "fireAlarm", "floodAlarm", "gate", "hue", "humidity", "illuminance", "image", "info", "instance", "light", "location", "lock", "media", "motion", "rgb", "rgbSingle", "rgbwSingle", "slider", "socket", "temperature", "thermostat", "vacuumCleaner", "volume", "volumeGroup", "warning", "weatherCurrent", "weatherForecast", "window", "windowTilt", "hub3", "node", "controller", "hub5"];
|
|
3
|
+
declare const deviceTypes: readonly ["unknown", "airCondition", "blind", "blindButtons", "button", "buttonSensor", "camera", "chart", "cie", "ct", "dimmer", "door", "fireAlarm", "floodAlarm", "gate", "hue", "humidity", "illuminance", "image", "info", "instance", "invalid", "light", "location", "lock", "media", "motion", "rgb", "rgbSingle", "rgbwSingle", "slider", "socket", "temperature", "thermostat", "vacuumCleaner", "volume", "volumeGroup", "warning", "weatherCurrent", "weatherForecast", "window", "windowTilt", "hub3", "node", "controller", "hub5"];
|
|
4
4
|
export type DeviceType = (typeof deviceTypes)[number];
|
|
5
5
|
export declare function isDeviceIcon(icon: string): DeviceType | null;
|
|
6
6
|
export declare function getDeviceIcon(type: DeviceType, props?: IconProps): React.JSX.Element | null;
|
|
@@ -28,6 +28,7 @@ const deviceTypes = [
|
|
|
28
28
|
'image',
|
|
29
29
|
'info',
|
|
30
30
|
'instance',
|
|
31
|
+
'invalid',
|
|
31
32
|
'light',
|
|
32
33
|
'location',
|
|
33
34
|
'lock',
|
|
@@ -193,7 +194,7 @@ export function getDeviceIcon(type, props) {
|
|
|
193
194
|
if (type === 'vacuumCleaner') {
|
|
194
195
|
SvgComponent = IconVacuum;
|
|
195
196
|
}
|
|
196
|
-
if (type === 'warning') {
|
|
197
|
+
if (type === 'warning' || type === 'invalid') {
|
|
197
198
|
SvgComponent = Warning;
|
|
198
199
|
}
|
|
199
200
|
if (SvgComponent) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IconDeviceType.js","sourceRoot":"./src/","sources":["Components/IconDeviceType.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EACH,MAAM,EACN,GAAG,EACH,MAAM,EACN,YAAY,EACZ,SAAS,EACT,aAAa,EACb,SAAS,EACT,aAAa,EACb,WAAW,EACX,QAAQ,EACR,GAAG,EACH,K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AAI,KAAK,SAAS,EAAE,CAAC;QACrB,YAAY,GAAG,YAAY,CAAC;IAChC,CAAC;IACD,IAAI,IAAI,KAAK,eAAe,EAAE,CAAC;QAC3B,YAAY,GAAG,UAA8B,CAAC;IAClD,CAAC;IACD,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;QACrB,YAAY,GAAG,OAAO,CAAC;IAC3B,CAAC;IAED,IAAI,YAAY,EAAE,CAAC;QACf,OAAO,CACH,oBAAC,YAAY,IACT,KAAK,EAAE,KAAK,EAAE,KAAK,IAAI,SAAS,EAChC,SAAS,EAAE,KAAK,CAAC,IAAI,CAAC,KAAK,EAAE,SAAS,EAAE,SAAS,CAAC,GACpD,CACL,CAAC;IACN,CAAC;IACD,OAAO,IAAI,CAAC;AAChB,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,KAAgB;IAC3C,MAAM,IAAI,GAAG,aAAa,CAAC,KAAK,CAAC,GAAiB,EAAE,KAAK,CAAC,CAAC;IAC3D,IAAI,IAAI,EAAE,CAAC;QACP,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,OAAO,oBAAC,IAAI,OAAK,KAAK,GAAI,CAAC;AAC/B,CAAC","sourcesContent":["import React from 'react';\nimport {\n AcUnit,\n Air,\n Blinds,\n BlindsClosed,\n ColorLens,\n ControlCamera,\n DeviceHub,\n DirectionsRun,\n DoorSliding,\n Gradient,\n Hub,\n Image,\n Info,\n Lightbulb,\n LocationOn,\n Lock,\n Palette,\n PlayArrowRounded,\n Polyline,\n Power,\n QuestionMark,\n SensorDoor,\n type SvgIconComponent,\n Thermostat,\n Timeline,\n TipsAndUpdates,\n Tune,\n Videocam,\n VolumeUp,\n Warning,\n Water,\n WaterDrop,\n WbIridescent,\n WbSunny,\n Whatshot,\n Window,\n} from '@mui/icons-material';\nimport { Icon, type IconProps } from './Icon';\nimport { Utils } from './Utils';\nimport { IconButtonImage } from '../icons/IconButtonImage';\nimport { IconVacuum } from '../icons/IconVacuum';\nimport { IconInstance } from '../icons/IconInstance';\n\n// Taken from type detector: https://github.com/ioBroker/ioBroker.type-detector/blob/master/src/types.ts#L27\nconst deviceTypes = [\n 'unknown',\n 'airCondition',\n 'blind',\n 'blindButtons',\n 'button',\n 'buttonSensor',\n 'camera',\n 'chart',\n 'cie',\n 'ct',\n 'dimmer',\n 'door',\n 'fireAlarm',\n 'floodAlarm',\n 'gate',\n 'hue',\n 'humidity',\n 'illuminance',\n 'image',\n 'info',\n 'instance',\n 'light',\n 'location',\n 'lock',\n 'media',\n 'motion',\n 'rgb',\n 'rgbSingle',\n 'rgbwSingle',\n 'slider',\n 'socket',\n 'temperature',\n 'thermostat',\n 'vacuumCleaner',\n 'volume',\n 'volumeGroup',\n 'warning',\n 'weatherCurrent',\n 'weatherForecast',\n 'window',\n 'windowTilt',\n 'hub3',\n 'node',\n 'controller',\n 'hub5',\n] as const;\n\nexport type DeviceType = (typeof deviceTypes)[number];\n\nexport function isDeviceIcon(icon: string): DeviceType | null {\n if (deviceTypes.includes(icon as DeviceType)) {\n return icon as DeviceType;\n }\n return null;\n}\n\nexport function getDeviceIcon(type: DeviceType, props?: IconProps): React.JSX.Element | null {\n let SvgComponent: SvgIconComponent | undefined;\n if (type === 'hub3') {\n SvgComponent = DeviceHub;\n }\n if (type === 'node') {\n SvgComponent = Polyline;\n }\n if (type === 'hub5') {\n SvgComponent = Hub;\n }\n if (type === 'controller') {\n SvgComponent = ControlCamera;\n }\n if (type === 'airCondition') {\n SvgComponent = AcUnit;\n }\n if (type === 'blind') {\n SvgComponent = Blinds;\n }\n if (type === 'camera') {\n SvgComponent = Videocam;\n }\n if (type === 'chart') {\n SvgComponent = Timeline;\n }\n if (type === 'ct') {\n SvgComponent = Gradient;\n }\n if (type === 'dimmer') {\n SvgComponent = TipsAndUpdates;\n }\n if (type === 'door') {\n SvgComponent = SensorDoor;\n }\n if (type === 'fireAlarm') {\n SvgComponent = Whatshot;\n }\n if (type === 'floodAlarm') {\n SvgComponent = Water;\n }\n if (type === 'humidity') {\n SvgComponent = WaterDrop;\n }\n if (type === 'illuminance') {\n SvgComponent = WbIridescent;\n }\n if (type === 'image') {\n SvgComponent = Image;\n }\n if (type === 'light') {\n SvgComponent = Lightbulb;\n }\n if (type === 'lock') {\n SvgComponent = Lock;\n }\n if (type === 'location') {\n SvgComponent = LocationOn;\n }\n if (type === 'media') {\n SvgComponent = PlayArrowRounded;\n }\n if (type === 'motion') {\n SvgComponent = DirectionsRun;\n }\n if (type === 'rgb') {\n SvgComponent = Palette;\n }\n if (type === 'rgbSingle') {\n SvgComponent = Palette;\n }\n if (type === 'rgbwSingle') {\n SvgComponent = Palette;\n }\n if (type === 'slider') {\n SvgComponent = Tune;\n }\n if (type === 'socket') {\n SvgComponent = Power;\n }\n if (type === 'temperature') {\n SvgComponent = Thermostat;\n }\n if (type === 'thermostat') {\n SvgComponent = Thermostat;\n }\n if (type === 'volume') {\n SvgComponent = VolumeUp;\n }\n if (type === 'volumeGroup') {\n SvgComponent = VolumeUp;\n }\n if (type === 'weatherCurrent') {\n SvgComponent = Air;\n }\n if (type === 'weatherForecast') {\n SvgComponent = WbSunny;\n }\n if (type === 'window') {\n SvgComponent = Window;\n }\n if (type === 'windowTilt') {\n SvgComponent = Window;\n }\n if (type === 'blindButtons') {\n SvgComponent = BlindsClosed;\n }\n if (type === 'button') {\n SvgComponent = IconButtonImage as SvgIconComponent;\n }\n if (type === 'buttonSensor') {\n SvgComponent = IconButtonImage as SvgIconComponent;\n }\n if (type === 'cie') {\n SvgComponent = ColorLens;\n }\n if (type === 'gate') {\n SvgComponent = DoorSliding;\n }\n if (type === 'hue') {\n SvgComponent = ColorLens;\n }\n if (type === 'info') {\n SvgComponent = Info;\n }\n if (type === 'instance') {\n SvgComponent = IconInstance as SvgIconComponent;\n }\n if (type === 'unknown') {\n SvgComponent = QuestionMark;\n }\n if (type === 'vacuumCleaner') {\n SvgComponent = IconVacuum as SvgIconComponent;\n }\n if (type === 'warning') {\n SvgComponent = Warning;\n }\n\n if (SvgComponent) {\n return (\n <SvgComponent\n style={props?.style || undefined}\n className={Utils.clsx(props?.className, 'iconOwn')}\n />\n );\n }\n return null;\n}\n\nexport function IconDeviceType(props: IconProps): React.JSX.Element | null {\n const icon = getDeviceIcon(props.src as DeviceType, props);\n if (icon) {\n return icon;\n }\n\n return <Icon {...props} />;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"IconDeviceType.js","sourceRoot":"./src/","sources":["Components/IconDeviceType.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EACH,MAAM,EACN,GAAG,EACH,MAAM,EACN,YAAY,EACZ,SAAS,EACT,aAAa,EACb,SAAS,EACT,aAAa,EACb,WAAW,EACX,QAAQ,EACR,GAAG,EACH,KAAK,EACL,IAAI,EACJ,SAAS,EACT,UAAU,EACV,IAAI,EACJ,OAAO,EACP,gBAAgB,EAChB,QAAQ,EACR,KAAK,EACL,YAAY,EACZ,UAAU,EAEV,UAAU,EACV,QAAQ,EACR,cAAc,EACd,IAAI,EACJ,QAAQ,EACR,QAAQ,EACR,OAAO,EACP,KAAK,EACL,SAAS,EACT,YAAY,EACZ,OAAO,EACP,QAAQ,EACR,MAAM,GACT,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,IAAI,EAAkB,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAErD,4GAA4G;AAC5G,MAAM,WAAW,GAAG;IAChB,SAAS;IACT,cAAc;IACd,OAAO;IACP,cAAc;IACd,QAAQ;IACR,cAAc;IACd,QAAQ;IACR,OAAO;IACP,KAAK;IACL,IAAI;IACJ,QAAQ;IACR,MAAM;IACN,WAAW;IACX,YAAY;IACZ,MAAM;I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CAAC","sourcesContent":["import React from 'react';\nimport {\n AcUnit,\n Air,\n Blinds,\n BlindsClosed,\n ColorLens,\n ControlCamera,\n DeviceHub,\n DirectionsRun,\n DoorSliding,\n Gradient,\n Hub,\n Image,\n Info,\n Lightbulb,\n LocationOn,\n Lock,\n Palette,\n PlayArrowRounded,\n Polyline,\n Power,\n QuestionMark,\n SensorDoor,\n type SvgIconComponent,\n Thermostat,\n Timeline,\n TipsAndUpdates,\n Tune,\n Videocam,\n VolumeUp,\n Warning,\n Water,\n WaterDrop,\n WbIridescent,\n WbSunny,\n Whatshot,\n Window,\n} from '@mui/icons-material';\nimport { Icon, type IconProps } from './Icon';\nimport { Utils } from './Utils';\nimport { IconButtonImage } from '../icons/IconButtonImage';\nimport { IconVacuum } from '../icons/IconVacuum';\nimport { IconInstance } from '../icons/IconInstance';\n\n// Taken from type detector: https://github.com/ioBroker/ioBroker.type-detector/blob/master/src/types.ts#L27\nconst deviceTypes = [\n 'unknown',\n 'airCondition',\n 'blind',\n 'blindButtons',\n 'button',\n 'buttonSensor',\n 'camera',\n 'chart',\n 'cie',\n 'ct',\n 'dimmer',\n 'door',\n 'fireAlarm',\n 'floodAlarm',\n 'gate',\n 'hue',\n 'humidity',\n 'illuminance',\n 'image',\n 'info',\n 'instance',\n 'invalid',\n 'light',\n 'location',\n 'lock',\n 'media',\n 'motion',\n 'rgb',\n 'rgbSingle',\n 'rgbwSingle',\n 'slider',\n 'socket',\n 'temperature',\n 'thermostat',\n 'vacuumCleaner',\n 'volume',\n 'volumeGroup',\n 'warning',\n 'weatherCurrent',\n 'weatherForecast',\n 'window',\n 'windowTilt',\n 'hub3',\n 'node',\n 'controller',\n 'hub5',\n] as const;\n\nexport type DeviceType = (typeof deviceTypes)[number];\n\nexport function isDeviceIcon(icon: string): DeviceType | null {\n if (deviceTypes.includes(icon as DeviceType)) {\n return icon as DeviceType;\n }\n return null;\n}\n\nexport function getDeviceIcon(type: DeviceType, props?: IconProps): React.JSX.Element | null {\n let SvgComponent: SvgIconComponent | undefined;\n if (type === 'hub3') {\n SvgComponent = DeviceHub;\n }\n if (type === 'node') {\n SvgComponent = Polyline;\n }\n if (type === 'hub5') {\n SvgComponent = Hub;\n }\n if (type === 'controller') {\n SvgComponent = ControlCamera;\n }\n if (type === 'airCondition') {\n SvgComponent = AcUnit;\n }\n if (type === 'blind') {\n SvgComponent = Blinds;\n }\n if (type === 'camera') {\n SvgComponent = Videocam;\n }\n if (type === 'chart') {\n SvgComponent = Timeline;\n }\n if (type === 'ct') {\n SvgComponent = Gradient;\n }\n if (type === 'dimmer') {\n SvgComponent = TipsAndUpdates;\n }\n if (type === 'door') {\n SvgComponent = SensorDoor;\n }\n if (type === 'fireAlarm') {\n SvgComponent = Whatshot;\n }\n if (type === 'floodAlarm') {\n SvgComponent = Water;\n }\n if (type === 'humidity') {\n SvgComponent = WaterDrop;\n }\n if (type === 'illuminance') {\n SvgComponent = WbIridescent;\n }\n if (type === 'image') {\n SvgComponent = Image;\n }\n if (type === 'light') {\n SvgComponent = Lightbulb;\n }\n if (type === 'lock') {\n SvgComponent = Lock;\n }\n if (type === 'location') {\n SvgComponent = LocationOn;\n }\n if (type === 'media') {\n SvgComponent = PlayArrowRounded;\n }\n if (type === 'motion') {\n SvgComponent = DirectionsRun;\n }\n if (type === 'rgb') {\n SvgComponent = Palette;\n }\n if (type === 'rgbSingle') {\n SvgComponent = Palette;\n }\n if (type === 'rgbwSingle') {\n SvgComponent = Palette;\n }\n if (type === 'slider') {\n SvgComponent = Tune;\n }\n if (type === 'socket') {\n SvgComponent = Power;\n }\n if (type === 'temperature') {\n SvgComponent = Thermostat;\n }\n if (type === 'thermostat') {\n SvgComponent = Thermostat;\n }\n if (type === 'volume') {\n SvgComponent = VolumeUp;\n }\n if (type === 'volumeGroup') {\n SvgComponent = VolumeUp;\n }\n if (type === 'weatherCurrent') {\n SvgComponent = Air;\n }\n if (type === 'weatherForecast') {\n SvgComponent = WbSunny;\n }\n if (type === 'window') {\n SvgComponent = Window;\n }\n if (type === 'windowTilt') {\n SvgComponent = Window;\n }\n if (type === 'blindButtons') {\n SvgComponent = BlindsClosed;\n }\n if (type === 'button') {\n SvgComponent = IconButtonImage as SvgIconComponent;\n }\n if (type === 'buttonSensor') {\n SvgComponent = IconButtonImage as SvgIconComponent;\n }\n if (type === 'cie') {\n SvgComponent = ColorLens;\n }\n if (type === 'gate') {\n SvgComponent = DoorSliding;\n }\n if (type === 'hue') {\n SvgComponent = ColorLens;\n }\n if (type === 'info') {\n SvgComponent = Info;\n }\n if (type === 'instance') {\n SvgComponent = IconInstance as SvgIconComponent;\n }\n if (type === 'unknown') {\n SvgComponent = QuestionMark;\n }\n if (type === 'vacuumCleaner') {\n SvgComponent = IconVacuum as SvgIconComponent;\n }\n if (type === 'warning' || type === 'invalid') {\n SvgComponent = Warning;\n }\n\n if (SvgComponent) {\n return (\n <SvgComponent\n style={props?.style || undefined}\n className={Utils.clsx(props?.className, 'iconOwn')}\n />\n );\n }\n return null;\n}\n\nexport function IconDeviceType(props: IconProps): React.JSX.Element | null {\n const icon = getDeviceIcon(props.src as DeviceType, props);\n if (icon) {\n return icon;\n }\n\n return <Icon {...props} />;\n}\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright 2020-
|
|
2
|
+
* Copyright 2020-2025, Denis Haev <dogafox@gmail.com>
|
|
3
3
|
*
|
|
4
4
|
* MIT License
|
|
5
5
|
*
|
|
@@ -1613,12 +1613,20 @@ function formatValue(options) {
|
|
|
1613
1613
|
valText.v = v;
|
|
1614
1614
|
}
|
|
1615
1615
|
}
|
|
1616
|
+
if (valText.v?.length > 40) {
|
|
1617
|
+
valText.v = `${valText.v.substring(0, 40)}...`;
|
|
1618
|
+
}
|
|
1616
1619
|
if (isCommon?.unit) {
|
|
1617
1620
|
valText.u = isCommon.unit;
|
|
1618
1621
|
}
|
|
1619
1622
|
let valFull;
|
|
1620
1623
|
if (options.full) {
|
|
1621
|
-
|
|
1624
|
+
if (typeof v === 'string' && v.length > 100) {
|
|
1625
|
+
valFull = [{ t: texts.value, v: `${v.substring(0, 100)}...` }];
|
|
1626
|
+
}
|
|
1627
|
+
else {
|
|
1628
|
+
valFull = [{ t: texts.value, v }];
|
|
1629
|
+
}
|
|
1622
1630
|
if (state) {
|
|
1623
1631
|
if (state.ack !== undefined && state.ack !== null) {
|
|
1624
1632
|
valFull.push({ t: texts.ack, v: state.ack.toString() });
|