diff --git a/DEVICES.md b/DEVICES.md index 4855891..992a8a9 100644 --- a/DEVICES.md +++ b/DEVICES.md @@ -34,6 +34,7 @@ What is not important for detection: ## Devices In [brackets] is given the class name of device. ### Content +* [Illuminance [Illuminance]](#illuminance) * [Air conditioner [airCondition]](#air-conditioner-aircondition) * [Blinds controlled only by buttons [blindButtons]](#blinds-controlled-only-by-buttons-blindbuttons) * [Blinds or Shutter [blinds]](#blinds-or-shutter-blinds) @@ -73,6 +74,16 @@ In [brackets] is given the class name of device. * [Weather forecast [weatherForecast]](#weather-forecast-weatherforecast) * [Window [window]](#window-window) * [Window that could be in tilted state [windowTilt]](#window-that-could-be-in-tilted-state-windowtilt) +### Illuminance +| R | Name | Role | Unit | Type | Wr | Ind | Mult | Regex | +|---|----------|-------------------------------|------|---------|----|-----|------|--------------------------------------------------------------------------------| +| * | ACTUAL | value.brightness | % | number | - | | | ``/brightness$/`` | +| | UNREACH | indicator.maintenance.unreach | | boolean | | X | | ``/^indicator(\.maintenance)?\.unreach$/`` | +| | LOWBAT | indicator.maintenance.lowbat | | boolean | | X | | ``/^indicator(\.maintenance)?\.lowbat$|^indicator(\.maintenance)?\.battery$/`` | +| | MAINTAIN | indicator.maintenance | | boolean | | X | | ``/^indicator\.maintenance$/`` | +| | ERROR | indicator.error | | | | X | | ``/^indicator\.error$/`` | + + ### Air conditioner [airCondition] | R | Name | Role | Unit | Type | Wr | Ind | Mult | Regex | |---|----------------|-------------------------------|------|----------------|----|-----|------|--------------------------------------------| diff --git a/src/TypePatterns.ts b/src/TypePatterns.ts index fceb1ca..51894f4 100644 --- a/src/TypePatterns.ts +++ b/src/TypePatterns.ts @@ -2897,6 +2897,25 @@ export const patterns: { [key: string]: InternalPatternControl } = { ], type: Types.humidity, }, + illuminance: { + states: [ + { + role: /brightness$/, + indicator: false, + write: false, + type: StateType.Number, + name: 'ACTUAL', + required: true, + defaultRole: 'value.brightness', + defaultUnit: '%', + }, + SharedPatterns.unreach, + SharedPatterns.lowbat, + SharedPatterns.maintain, + SharedPatterns.error, + ], + type: Types.illuminance, + }, image: { states: [ { diff --git a/src/types.ts b/src/types.ts index 808350f..5e0497a 100644 --- a/src/types.ts +++ b/src/types.ts @@ -42,6 +42,7 @@ export enum Types { gate = 'gate', hue = 'hue', humidity = 'humidity', + illuminance = 'illuminance', image = 'image', info = 'info', instance = 'instance',