]> git.basschouten.com Git - openhab-addons.git/commitdiff
[homekit] implement all AccessoryInformationService characteristics (#17031)
authorCody Cutrer <cody@cutrer.us>
Tue, 9 Jul 2024 18:01:14 +0000 (12:01 -0600)
committerGitHub <noreply@github.com>
Tue, 9 Jul 2024 18:01:14 +0000 (20:01 +0200)
mostly as metadata static characteristics

fixes #9595

Signed-off-by: Cody Cutrer <cody@cutrer.us>
43 files changed:
bundles/org.openhab.io.homekit/README.md
bundles/org.openhab.io.homekit/pom.xml
bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/HomekitChangeListener.java
bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/HomekitCharacteristicType.java
bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/accessories/AbstractHomekitAccessoryImpl.java
bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/accessories/HomekitAccessoryFactory.java
bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/accessories/HomekitAirQualitySensorImpl.java
bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/accessories/HomekitBasicFanImpl.java
bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/accessories/HomekitBatteryImpl.java
bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/accessories/HomekitCarbonDioxideSensorImpl.java
bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/accessories/HomekitCarbonMonoxideSensorImpl.java
bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/accessories/HomekitCharacteristicFactory.java
bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/accessories/HomekitContactSensorImpl.java
bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/accessories/HomekitDoorImpl.java
bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/accessories/HomekitFanImpl.java
bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/accessories/HomekitFaucetImpl.java
bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/accessories/HomekitFilterMaintenanceImpl.java
bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/accessories/HomekitGarageDoorOpenerImpl.java
bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/accessories/HomekitHeaterCoolerImpl.java
bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/accessories/HomekitHumiditySensorImpl.java
bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/accessories/HomekitInputSourceImpl.java
bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/accessories/HomekitIrrigationSystemImpl.java
bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/accessories/HomekitLeakSensorImpl.java
bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/accessories/HomekitLightSensorImpl.java
bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/accessories/HomekitLightbulbImpl.java
bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/accessories/HomekitLockImpl.java
bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/accessories/HomekitMetadataCharacteristicFactory.java
bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/accessories/HomekitMicrophoneImpl.java
bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/accessories/HomekitMotionSensorImpl.java
bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/accessories/HomekitOccupancySensorImpl.java
bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/accessories/HomekitOutletImpl.java
bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/accessories/HomekitSecuritySystemImpl.java
bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/accessories/HomekitSlatImpl.java
bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/accessories/HomekitSmartSpeakerImpl.java
bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/accessories/HomekitSmokeSensorImpl.java
bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/accessories/HomekitSpeakerImpl.java
bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/accessories/HomekitSwitchImpl.java
bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/accessories/HomekitTelevisionImpl.java
bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/accessories/HomekitTemperatureSensorImpl.java
bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/accessories/HomekitThermostatImpl.java
bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/accessories/HomekitValveImpl.java
bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/accessories/HomekitWindowCoveringImpl.java
bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/accessories/HomekitWindowImpl.java

index cf399eb201b45d99a9d6e92a8e65c5b805f4517d..fe562d006c76d8e4e31b1210d83195f0cb76672f 100644 (file)
@@ -688,6 +688,19 @@ All enum values can be customized via item metadata. I.e. `HEAT="heating", COOL=
 They are appropriately marked.
 Enums that are linked to Switches or Contacts have an `inverted` param that will reverse the sense of `ON`/`OFF` or `OPEN`/`CLOSED`.
 
+All accessories support the following characteristics that can be set via metadata or linked to a String item:
+ * Name (defaults to item's label)
+ * Manufacturer (defaults to "none")
+ * Model (defaults to "none")
+ * SerialNumber (defaults to item's name)
+ * FirmwareRevision (defaults to "none")
+ * HardwareRevision (defaults to not present)
+
+Note that even though these characteristics can be linked to an item, they are not dynamic and cannot be updated once the Home app reads their initial values.
+
+All accessories also support the following optional characteristic that can be linked to a Switch item:
+ * Identify (receives `ON` command when the user wishes to identify the accessory)
+
 | Accessory Tag        | Mandatory Characteristics   | Optional Characteristics    | Supported openHAB item types            | Description                                                                                                                                                                                                                                                                                                                                                   | Configuration Options                                                 | Valid Enum Values                                                                                           |
 |----------------------|-----------------------------|-----------------------------|-----------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------|
 | AirQualitySensor     |                             |                             |                                         | Air Quality Sensor which can measure different parameters                                                                                                                                                                                                                                                                                                     |                                                                       |                                                                                                             |
@@ -695,7 +708,6 @@ Enums that are linked to Switches or Contacts have an `inverted` param that will
 |                      |                             | ActiveStatus                | Contact, Switch                         | Working status                                                                                                                                                                                                                                                                                                                                                |                                                                       |                                                                                                             |
 |                      |                             | BatteryLowStatus            | Contact, Number, Switch                 | Battery status                                                                                                                                                                                                                                                                                                                                                | inverted (false), lowThreshold (20)                                   |                                                                                                             |
 |                      |                             | FaultStatus                 | Contact, Number, String, Switch         | Fault status                                                                                                                                                                                                                                                                                                                                                  | inverted (false)                                                      | NO_FAULT (0, OFF, CLOSED), GENERAL_FAULT (1, ON, OPEN)                                                      |
-|                      |                             | Name                        | String                                  | Name of the sensor                                                                                                                                                                                                                                                                                                                                            |                                                                       |                                                                                                             |
 |                      |                             | NitrogenDioxideDensity      | Number                                  | NO2 density in micrograms/m3, max 1000                                                                                                                                                                                                                                                                                                                        |                                                                       |                                                                                                             |
 |                      |                             | OzoneDensity                | Number                                  | Ozone density in micrograms/m3, max 1000                                                                                                                                                                                                                                                                                                                      |                                                                       |                                                                                                             |
 |                      |                             | PM10Density                 | Number                                  | PM10 micrometer particulate density in micrograms/m3, max 1000                                                                                                                                                                                                                                                                                                |                                                                       |                                                                                                             |
@@ -711,7 +723,6 @@ Enums that are linked to Switches or Contacts have an `inverted` param that will
 |                      | BatteryLevel                |                             | Number                                  | Battery level 0% to 100%                                                                                                                                                                                                                                                                                                                                      |                                                                       |                                                                                                             |
 |                      | BatteryChargingState        |                             | Contact, Dimmer, Switch                 | Mandatory only for chargeable battery. ON/OPEN =  battery is charging                                                                                                                                                                                                                                                                                         |                                                                       |                                                                                                             |
 |                      | BatteryLowStatus            |                             | Contact, Number, Switch                 | Battery low indicator. ON/OPEN = battery level is low; for number if the value is below the lowThreshold, then it is low. Default is 20.                                                                                                                                                                                                                      | inverted (false), lowThreshold (20)                                   |                                                                                                             |
-|                      |                             | Name                        | String                                  | Name of the battery accessory                                                                                                                                                                                                                                                                                                                                 |                                                                       |                                                                                                             |
 | CarbonDioxideSensor  |                             |                             |                                         | Carbon Dioxide Sensor                                                                                                                                                                                                                                                                                                                                         |                                                                       |                                                                                                             |
 |                      | CarbonDioxideDetectedState  |                             | Contact, Dimmer, Switch, Number, String | carbon dioxide sensor state                                                                                                                                                                                                                                                                                                                                   | inverted (false)                                                      | NORMAL (0, OFF, CLOSED), ABNORMAL (1, ON, OPEN)                                                             |
 |                      |                             | ActiveStatus                | Contact, Switch                         | Working status                                                                                                                                                                                                                                                                                                                                                |                                                                       |                                                                                                             |
@@ -719,7 +730,6 @@ Enums that are linked to Switches or Contacts have an `inverted` param that will
 |                      |                             | CarbonDioxideLevel          | Number                                  | Carbon dioxide level in ppm, max 100000                                                                                                                                                                                                                                                                                                                       |                                                                       |                                                                                                             |
 |                      |                             | CarbonDioxidePeakLevel      | Number                                  | highest detected level (ppm) of carbon dioxide detected by a sensor, max 100000                                                                                                                                                                                                                                                                               |                                                                       |                                                                                                             |
 |                      |                             | FaultStatus                 | Contact, Number, String, Switch         | Fault status                                                                                                                                                                                                                                                                                                                                                  | inverted (false)                                                      | NO_FAULT (0, OFF, CLOSED), GENERAL_FAULT (1, ON, OPEN)                                                      |
-|                      |                             | Name                        | String                                  | Name of the sensor                                                                                                                                                                                                                                                                                                                                            |                                                                       |                                                                                                             |
 |                      |                             | TamperedStatus              | Contact, Number, String, Switch         | Tampered status                                                                                                                                                                                                                                                                                                                                               | inverted (false)                                                      | NOT_TAMPERED (0, OFF, CLOSED), TAMPERED (1, ON, OPEN)                                                       |
 | CarbonMonoxideSensor |                             |                             |                                         | Carbon monoxide Sensor                                                                                                                                                                                                                                                                                                                                        |                                                                       |                                                                                                             |
 |                      | CarbonMonoxideDetectedState |                             | Contact, Dimmer, Switch, Number, String | Carbon monoxide sensor state                                                                                                                                                                                                                                                                                                                                  | inverted (false)                                                      | NORMAL (0, OFF, CLOSED), ABNORMAL (1, ON, OPEN)                                                             |
@@ -728,21 +738,18 @@ Enums that are linked to Switches or Contacts have an `inverted` param that will
 |                      |                             | CarbonMonoxideLevel         | Number                                  | Carbon monoxide level in ppm, max 100                                                                                                                                                                                                                                                                                                                         |                                                                       |                                                                                                             |
 |                      |                             | CarbonMonoxidePeakLevel     | Number                                  | highest detected level (ppm) of carbon monoxide detected by a sensor, max 100                                                                                                                                                                                                                                                                                 |                                                                       |                                                                                                             |
 |                      |                             | FaultStatus                 | Contact, Number, String, Switch         | Fault status                                                                                                                                                                                                                                                                                                                                                  | inverted (false)                                                      | NO_FAULT (0, OFF, CLOSED), GENERAL_FAULT (1, ON, OPEN)                                                      |
-|                      |                             | Name                        | String                                  | Name of the sensor                                                                                                                                                                                                                                                                                                                                            |                                                                       |                                                                                                             |
 |                      |                             | TamperedStatus              | Contact, Number, String, Switch         | Tampered status                                                                                                                                                                                                                                                                                                                                               | inverted (false)                                                      | NOT_TAMPERED (0, OFF, CLOSED), TAMPERED (1, ON, OPEN)                                                       |
 | ContactSensor        |                             |                             |                                         | Contact Sensor, An accessory with on/off state that can be viewed in HomeKit but not changed such as a contact sensor for a door or window                                                                                                                                                                                                                    |                                                                       |                                                                                                             |
 |                      | ContactSensorState          |                             | Contact, Dimmer, Number, String, Switch | Contact sensor state                                                                                                                                                                                                                                                                                                                                          | inverted (false)                                                      | DETECTED (0, OFF, CLOSED), NOT_DETECTED (1, ON, OPEN)                                                       |
 |                      |                             | ActiveStatus                | Contact, Switch                         | Working status                                                                                                                                                                                                                                                                                                                                                |                                                                       |                                                                                                             |
 |                      |                             | BatteryLowStatus            | Contact, Number, Switch                 | Battery status                                                                                                                                                                                                                                                                                                                                                | inverted (false), lowThreshold (20)                                   |                                                                                                             |
 |                      |                             | FaultStatus                 | Contact, Number, String, Switch         | Fault status                                                                                                                                                                                                                                                                                                                                                  | inverted (false)                                                      | NO_FAULT (0, OFF, CLOSED), GENERAL_FAULT (1, ON, OPEN)                                                      |
-|                      |                             | Name                        | String                                  | Name of the sensor                                                                                                                                                                                                                                                                                                                                            |                                                                       |                                                                                                             |
 |                      |                             | TamperedStatus              | Contact, Number, String, Switch         | Tampered status                                                                                                                                                                                                                                                                                                                                               | inverted (false)                                                      | NOT_TAMPERED (0, OFF, CLOSED), TAMPERED (1, ON, OPEN)                                                       |
 | Door                 |                             |                             |                                         | Motorized door. One Rollershutter item covers all mandatory characteristics. see examples below.                                                                                                                                                                                                                                                              |                                                                       |                                                                                                             |
 |                      | CurrentPosition             |                             | Dimmer, Number, Rollershutter           | Current position of motorized door                                                                                                                                                                                                                                                                                                                            |                                                                       |                                                                                                             |
 |                      | PositionState               |                             | Number, Rollershutter, String           | Position state. If no state is provided, "STOPPED" is used.                                                                                                                                                                                                                                                                                                   |                                                                       | DECREASING (0), INCREASING (1), STOPPED (2)                                                                 |
 |                      | TargetPosition              |                             | Dimmer, Number, Rollershutter           | Target position of motorized door                                                                                                                                                                                                                                                                                                                             |                                                                       |                                                                                                             |
 |                      |                             | HoldPosition                | Rollershutter, Switch                   | Motorized door should stop at its current position. ON is sent to Switch items. STOP is sent to Rollershutter items. Only supported by 3rd party Home apps (such as Elgato Eve)                                                                                                                                                                               |                                                                       |                                                                                                             |
-|                      |                             | Name                        | String                                  | Name of the motorized door                                                                                                                                                                                                                                                                                                                                    |                                                                       |                                                                                                             |
 |                      |                             | ObstructionStatus           | Contact, Dimmer, Switch                 | Current status of obstruction sensor. ON-obstruction detected, OFF - no obstruction                                                                                                                                                                                                                                                                           |                                                                       |                                                                                                             |
 | Fan                  |                             |                             |                                         | Fan                                                                                                                                                                                                                                                                                                                                                           |                                                                       |                                                                                                             |
 |                      | ActiveStatus                |                             | Dimmer, Switch                          | Accessory current working status. A value of "ON"/"OPEN" indicates that the accessory is active and is functioning without any errors.                                                                                                                                                                                                                        |                                                                       |                                                                                                             |
@@ -755,17 +762,14 @@ Enums that are linked to Switches or Contacts have an `inverted` param that will
 | Faucet               |                             |                             |                                         | Faucet or shower. It should be used in combination with Valve or/and HeaterCooler.                                                                                                                                                                                                                                                                            |                                                                       |                                                                                                             |
 |                      | Active                      |                             | Contact, Dimmer, Switch                 | Accessory current working status                                                                                                                                                                                                                                                                                                                              | inverted (false)                                                      |                                                                                                             |
 |                      |                             | FaultStatus                 | Contact, Number, String, Switch         | Fault status                                                                                                                                                                                                                                                                                                                                                  | inverted (false)                                                      | NO_FAULT (0, OFF, CLOSED), GENERAL_FAULT (1, ON, OPEN)                                                      |
-|                      |                             | Name                        | String                                  | Name of the Faucet                                                                                                                                                                                                                                                                                                                                            |                                                                       |                                                                                                             |
 | Filter               |                             |                             |                                         | Accessory with filter maintenance indicator                                                                                                                                                                                                                                                                                                                   |                                                                       |                                                                                                             |
 |                      | FilterChangeIndication      |                             | Contact, Dimmer, Number, String, Switch | Filter change indicator                                                                                                                                                                                                                                                                                                                                       | inverted (false)                                                      | NO_CHANGED_NEEDED (0, OFF, CLOSED), CHANGE_NEEDED (1, ON, OPEN)                                             |
 |                      |                             | FilterLifeLevel             | Number                                  | Current filter life level. 0% to 100%                                                                                                                                                                                                                                                                                                                         |                                                                       |                                                                                                             |
 |                      |                             | FilterResetIndication       | Switch                                  | Send "filter reset" action triggered by user in iOS Home app to openHAB ("ON" = reset requested by user).                                                                                                                                                                                                                                                     |                                                                       |                                                                                                             |
-|                      |                             | Name                        | String                                  | Name of the filter accessory                                                                                                                                                                                                                                                                                                                                  |                                                                       |                                                                                                             |
 | GarageDoorOpener     |                             |                             |                                         | A garage door opener.                                                                                                                                                                                                                                                                                                                                         |                                                                       |                                                                                                             |
 |                      | CurrentDoorState            |                             | Contact, Switch, Number, String         | Current door state.                                                                                                                                                                                                                                                                                                                                           | inverted (false)                                                      | OPEN (0, ON, OPEN), CLOSED (1, OFF, CLOSED), OPENING (2), CLOSING (3), STOPPED (4)                          |
 |                      | ObstructionStatus           |                             | Contact, Switch                         | Current status of obstruction sensor. ON-obstruction detected, OFF - no obstruction                                                                                                                                                                                                                                                                           | inverted (false)                                                      |                                                                                                             |
 |                      | TargetDoorState             |                             | Contact, Switch, Number, String         | Target door state.                                                                                                                                                                                                                                                                                                                                            | inverted (false)                                                      | OPEN (0, ON, OPEN), CLOSED (1, OFF, CLOSED)                                                                 |
-|                      |                             | Name                        | String                                  | Name of the garage door                                                                                                                                                                                                                                                                                                                                       |                                                                       |                                                                                                             |
 | HeaterCooler         |                             |                             |                                         | Heater or/and cooler device                                                                                                                                                                                                                                                                                                                                   |                                                                       |                                                                                                             |
 |                      | ActiveStatus                |                             | Dimmer, Switch                          | Accessory current working status. A value of "ON"/"OPEN" indicates that the accessory is active and is functioning without any errors.                                                                                                                                                                                                                        |                                                                       |                                                                                                             |
 |                      | CurrentHeaterCoolerState    |                             | Number, String                          | Current heater/cooler mode.                                                                                                                                                                                                                                                                                                                                   |                                                                       | INACTIVE (0), IDLE (1), HEATING (2), COOLING (3)                                                            |
@@ -774,7 +778,6 @@ Enums that are linked to Switches or Contacts have an `inverted` param that will
 |                      |                             | CoolingThresholdTemperature | Number                                  | Maximum temperature that must be reached before cooling is turned on                                                                                                                                                                                                                                                                                          | minValue (10), maxValue (35), step (0.1)                              |                                                                                                             |
 |                      |                             | HeatingThresholdTemperature | Number                                  | Minimum temperature that must be reached before heating is turned on                                                                                                                                                                                                                                                                                          | minValue (0), maxValue (25), step (0.1)                               |                                                                                                             |
 |                      |                             | LockControl                 | Number, Switch, String                  | Status of physical control lock                                                                                                                                                                                                                                                                                                                               | inverted (false)                                                      | CONTROL_LOCK_DISABLED (0, OFF), CONTROL_LOCK_ENABLED (1, ON)                                                |
-|                      |                             | Name                        | String                                  | Name of the heater/cooler                                                                                                                                                                                                                                                                                                                                     |                                                                       |                                                                                                             |
 |                      |                             | RotationSpeed               | Number                                  | Fan rotation speed in % (1-100)                                                                                                                                                                                                                                                                                                                               |                                                                       |                                                                                                             |
 |                      |                             | SwingMode                   | Number, Switch, String                  | Swing mode                                                                                                                                                                                                                                                                                                                                                    | inverted (false)                                                      | SWING_DISABLED (0, OFF), SWING_ENABLED (1, ON)                                                              |
 | HumiditySensor       |                             |                             |                                         | Relative Humidity Sensor providing read-only values                                                                                                                                                                                                                                                                                                           |                                                                       |                                                                                                             |
@@ -782,10 +785,8 @@ Enums that are linked to Switches or Contacts have an `inverted` param that will
 |                      |                             | ActiveStatus                | Contact, Switch                         | Working status                                                                                                                                                                                                                                                                                                                                                |                                                                       |                                                                                                             |
 |                      |                             | BatteryLowStatus            | Contact, Number, Switch                 | Battery status                                                                                                                                                                                                                                                                                                                                                | inverted (false), lowThreshold (20)                                   |                                                                                                             |
 |                      |                             | FaultStatus                 | Contact, Number, String, Switch         | Fault status                                                                                                                                                                                                                                                                                                                                                  | inverted (false)                                                      | NO_FAULT (0, OFF, CLOSED), GENERAL_FAULT (1, ON, OPEN)                                                      |
-|                      |                             | Name                        | String                                  | Name of the sensor                                                                                                                                                                                                                                                                                                                                            |                                                                       |                                                                                                             |
 |                      |                             | TamperedStatus              | Contact, Number, String, Switch         | Tampered status                                                                                                                                                                                                                                                                                                                                               | inverted (false)                                                      | NOT_TAMPERED (0, OFF, CLOSED), TAMPERED (1, ON, OPEN)                                                       |
 | InputSource          |                             |                             |                                         | Input source linked service. Can only be used with Television.                                                                                                                                                                                                                                                                                                |                                                                       |                                                                                                             |
-|                      |                             | Name                        | String                                  | Default name of the input source                                                                                                                                                                                                                                                                                                                              |                                                                       |                                                                                                             |
 |                      |                             | ConfiguredName              | String                                  | Name of the input source configured in the iOS Home app. User can rename the source in iOS Home app and this characteristic can be used to reflect change in openHAB and sync name changes from openHAB to Home app.                                                                                                                                          |                                                                       |                                                                                                             |
 |                      |                             | Configured                  | Contact, Dimmer, Switch                 | If the source is configured on the device. Non-configured inputs will not show up in the Home app. - ON/OPEN = show, OFF/CLOSED = hide. Default is ON. Can also be configured via metadata, e.g. [Configured=true]                                                                                                                                            |                                                                       |                                                                                                             |
 |                      |                             | CurrentVisibility           | Contact, Dimmer, Number, String, Switch | If the source has been hidden by the user. Can also be configured via metadata, e.g. [CurrentVisibility=false]                                                                                                                                                                                                                                                | inverted (false)                                                      | SHOWN (0, ON), HIDDEN (1, OFF)                                                                              |
@@ -804,58 +805,48 @@ Enums that are linked to Switches or Contacts have an `inverted` param that will
 |                      |                             | ActiveStatus                | Contact, Switch                         | Working status                                                                                                                                                                                                                                                                                                                                                |                                                                       |                                                                                                             |
 |                      |                             | BatteryLowStatus            | Contact, Number, Switch                 | Battery status                                                                                                                                                                                                                                                                                                                                                | inverted (false), lowThreshold (20)                                   |                                                                                                             |
 |                      |                             | FaultStatus                 | Contact, Number, String, Switch         | Fault status                                                                                                                                                                                                                                                                                                                                                  | inverted (false)                                                      | NO_FAULT (0, OFF, CLOSED), GENERAL_FAULT (1, ON, OPEN)                                                      |
-|                      |                             | Name                        | String                                  | Name of the sensor                                                                                                                                                                                                                                                                                                                                            |                                                                       |                                                                                                             |
 |                      |                             | TamperedStatus              | Contact, Number, String, Switch         | Tampered status                                                                                                                                                                                                                                                                                                                                               | inverted (false)                                                      | NOT_TAMPERED (0, OFF, CLOSED), TAMPERED (1, ON, OPEN)                                                       |
 | LightSensor          |                             |                             |                                         | Light sensor                                                                                                                                                                                                                                                                                                                                                  |                                                                       |                                                                                                             |
 |                      | LightLevel                  |                             | Number                                  | Light level in lux                                                                                                                                                                                                                                                                                                                                            | minValue (0.0001), maxValue (100000)                                  |                                                                                                             |
 |                      |                             | ActiveStatus                | Contact, Switch                         | Working status                                                                                                                                                                                                                                                                                                                                                |                                                                       |                                                                                                             |
 |                      |                             | BatteryLowStatus            | Contact, Number, Switch                 | Battery status                                                                                                                                                                                                                                                                                                                                                | inverted (false), lowThreshold (20)                                   |                                                                                                             |
 |                      |                             | FaultStatus                 | Contact, Number, String, Switch         | Fault status                                                                                                                                                                                                                                                                                                                                                  | inverted (false)                                                      | NO_FAULT (0, OFF, CLOSED), GENERAL_FAULT (1, ON, OPEN)                                                      |
-|                      |                             | Name                        | String                                  | Name of the sensor                                                                                                                                                                                                                                                                                                                                            |                                                                       |                                                                                                             |
 |                      |                             | TamperedStatus              | Contact, Number, String, Switch         | Tampered status                                                                                                                                                                                                                                                                                                                                               | inverted (false)                                                      | NOT_TAMPERED (0, OFF, CLOSED), TAMPERED (1, ON, OPEN)                                                       |
 | Lighting             |                             |                             |                                         | A lightbulb, can have further optional parameters for brightness, hue, etc                                                                                                                                                                                                                                                                                    |                                                                       |                                                                                                             |
 |                      | OnState                     |                             | Switch                                  | State of the light - ON/OFF                                                                                                                                                                                                                                                                                                                                   |                                                                       |                                                                                                             |
 |                      |                             | Brightness                  | Dimmer, Color                           | Brightness in % (1-100). See "Usage of dimmer modes" for configuration details.                                                                                                                                                                                                                                                                               |                                                                       |                                                                                                             |
 |                      |                             | ColorTemperature            | Dimmer, Number                          | Color temperature. If the item is a Number with no units, it is represented in mireds. The default value range is from 50 to 400 (2500 K to 20,000 K). If the item is a Dimmer, it will be transformed linearly to mireds. Color temperature should not be used in combination with hue, saturation and brightness.                                           | minValue (50), maxValue (400), inverted                               |                                                                                                             |
 |                      |                             | Hue                         | Dimmer, Color                           | Hue                                                                                                                                                                                                                                                                                                                                                           |                                                                       |                                                                                                             |
-|                      |                             | Name                        | String                                  | Name of the light                                                                                                                                                                                                                                                                                                                                             |                                                                       |                                                                                                             |
 |                      |                             | Saturation                  | Dimmer, Color                           | Saturation in % (1-100)                                                                                                                                                                                                                                                                                                                                       |                                                                       |                                                                                                             |
 | Lock                 |                             |                             |                                         | A Lock Mechanism                                                                                                                                                                                                                                                                                                                                              | inverted (false)                                                      |                                                                                                             |
 |                      | LockCurrentState            |                             | Contact, Number, String, Switch         | Current state of lock mechanism                                                                                                                                                                                                                                                                                                                               | inverted (false)                                                      | UNSECURED (0, OFF, CLOSED), SECURED (1, ON, OPEN), JAMMED (2), UNKNOWN (3)                                  |
 |                      | LockTargetState             |                             | Number, String, Switch                  | Target state of lock mechanism                                                                                                                                                                                                                                                                                                                                | inverted (false)                                                      | UNSECURED (0, OFF), SECURED (1, ON)                                                                         |
-|                      |                             | Name                        | String                                  | Name of the lock                                                                                                                                                                                                                                                                                                                                              |                                                                       |                                                                                                             |
 | Microphone           |                             |                             |                                         | Microphone accessory                                                                                                                                                                                                                                                                                                                                          |                                                                       |                                                                                                             |
 |                      | Mute                        |                             | Contact, Dimmer, Switch                 | Mute indication. ON/OPEN = microphone is muted                                                                                                                                                                                                                                                                                                                | inverted (false)                                                      |                                                                                                             |
-|                      |                             | Name                        | String                                  | Name of the microphone accessory                                                                                                                                                                                                                                                                                                                              |                                                                       |                                                                                                             |
 |                      |                             | Volume                      | Number                                  | Microphone volume from 0% to 100%                                                                                                                                                                                                                                                                                                                             |                                                                       |                                                                                                             |
 | MotionSensor         |                             |                             |                                         | Motion Sensor                                                                                                                                                                                                                                                                                                                                                 |                                                                       |                                                                                                             |
 |                      | MotionDetectedState         |                             | Contact, Dimmer, Switch                 | Motion sensor state (ON=motion detected, OFF=no motion)                                                                                                                                                                                                                                                                                                       | inverted (false)                                                      |                                                                                                             |
 |                      |                             | ActiveStatus                | Contact, Switch                         | Working status                                                                                                                                                                                                                                                                                                                                                |                                                                       |                                                                                                             |
 |                      |                             | BatteryLowStatus            | Contact, Number, Switch                 | Battery status                                                                                                                                                                                                                                                                                                                                                | inverted (false), lowThreshold (20)                                   |                                                                                                             |
 |                      |                             | FaultStatus                 | Contact, Number, String, Switch         | Fault status                                                                                                                                                                                                                                                                                                                                                  | inverted (false)                                                      | NO_FAULT (0, OFF, CLOSED), GENERAL_FAULT (1, ON, OPEN)                                                      |
-|                      |                             | Name                        | String                                  | Name of the sensor                                                                                                                                                                                                                                                                                                                                            |                                                                       |                                                                                                             |
 |                      |                             | TamperedStatus              | Contact, Number, String, Switch         | Tampered status                                                                                                                                                                                                                                                                                                                                               | inverted (false)                                                      | NOT_TAMPERED (0, OFF, CLOSED), TAMPERED (1, ON, OPEN)                                                       |
 | OccupancySensor      |                             |                             |                                         | Occupancy Sensor                                                                                                                                                                                                                                                                                                                                              |                                                                       |                                                                                                             |
 |                      | OccupancyDetectedState      |                             | Contact, Dimmer, Number, String, Switch | Occupancy sensor state                                                                                                                                                                                                                                                                                                                                        | inverted (false)                                                      | NOT_DETECTED (0, OFF, CLOSED), DETECTED (1, ON, OPEN)                                                       |
 |                      |                             | ActiveStatus                | Contact, Switch                         | Working status                                                                                                                                                                                                                                                                                                                                                |                                                                       |                                                                                                             |
 |                      |                             | BatteryLowStatus            | Contact, Number, Switch                 | Battery status                                                                                                                                                                                                                                                                                                                                                | inverted (false), lowThreshold (20)                                   |                                                                                                             |
 |                      |                             | FaultStatus                 | Contact, Number, String, Switch         | Fault status                                                                                                                                                                                                                                                                                                                                                  | inverted (false)                                                      | NO_FAULT (0, OFF, CLOSED), GENERAL_FAULT (1, ON, OPEN)                                                      |
-|                      |                             | Name                        | String                                  | Name of the sensor                                                                                                                                                                                                                                                                                                                                            |                                                                       |                                                                                                             |
 |                      |                             | TamperedStatus              | Contact, Number, String, Switch         | Tampered status                                                                                                                                                                                                                                                                                                                                               | inverted (false)                                                      | NOT_TAMPERED (0, OFF, CLOSED), TAMPERED (1, ON, OPEN)                                                       |
 | Outlet               |                             |                             |                                         | An accessory that can be turned off and on. While similar to a lightbulb, this will be presented differently in the Siri grammar and iOS apps                                                                                                                                                                                                                 |                                                                       |                                                                                                             |
 |                      | InUseStatus                 |                             | Contact, Dimmer, Switch                 | Indicates whether the outlet has an appliance e.g., a floor lamp, physically plugged in. This characteristic is set to True even if the plugged-in appliance is off.                                                                                                                                                                                          | inverted (false)                                                      |                                                                                                             |
 |                      | OnState                     |                             | Dimmer, Switch                          | State of the outlet - ON/OFF                                                                                                                                                                                                                                                                                                                                  |                                                                       |                                                                                                             |
-|                      |                             | Name                        | String                                  | Name of the switch                                                                                                                                                                                                                                                                                                                                            |                                                                       |                                                                                                             |
 | SecuritySystem       |                             |                             |                                         | Security system.                                                                                                                                                                                                                                                                                                                                              |                                                                       |                                                                                                             |
 |                      | CurrentSecuritySystemState  |                             | Number, String                          | Current state of the security system                                                                                                                                                                                                                                                                                                                          |                                                                       | STAY_ARM (0), AWAY_ARM (1), NIGHT_ARM (2), DISARMED (3), TRIGGERED (4)                                      |
 |                      | TargetSecuritySystemState   |                             | Number, String                          | Requested state of the security system. While the requested state is not DISARM, and the current state is DISARMED, HomeKit will display "Arming...", for example during an exit delay.                                                                                                                                                                       |                                                                       | STAY_ARM (0), AWAY_ARM (1), NIGHT_ARM (2), DISARM (3)    [*](#customizable-enum)                            |
 |                      |                             | FaultStatus                 | Contact, Number, String, Switch         | Fault status                                                                                                                                                                                                                                                                                                                                                  | inverted (false)                                                      | NO_FAULT (0, OFF, CLOSED), GENERAL_FAULT (1, ON, OPEN)                                                      |
-|                      |                             | Name                        | String                                  | Name of the security system                                                                                                                                                                                                                                                                                                                                   |                                                                       |                                                                                                             |
 |                      |                             | TamperedStatus              | Contact, Number, String, Switch         | Tampered status                                                                                                                                                                                                                                                                                                                                               | inverted (false)                                                      | NOT_TAMPERED (0, OFF, CLOSED), TAMPERED (1, ON, OPEN)                                                       |
 | Slat                 |                             |                             |                                         | Slat which tilts on a vertical or a horizontal axis. Configuration "type:horizontal" or "type:vertical"                                                                                                                                                                                                                                                       |                                                                       |                                                                                                             |
 |                      | CurrentSlatState            |                             | Number, String                          | Current slat state.                                                                                                                                                                                                                                                                                                                                           |                                                                       | FIXED (0), JAMMED (1), SWINGING (2)                                                                         |
 |                      |                             | CurrentTiltAngle            | Dimmer, Number                          | Number Item = current angle of slats. values -90 to 90. A value of 0 indicates that the slats are rotated to a fully open position. Dimmer Item =  the percentage of openness (0%-100%)                                                                                                                                                                       |                                                                       |                                                                                                             |
-|                      |                             | Name                        | String                                  | Name of the slat                                                                                                                                                                                                                                                                                                                                              |                                                                       |                                                                                                             |
 |                      |                             | SwingMode                   | Number, Switch, String                  | Swing mode                                                                                                                                                                                                                                                                                                                                                    | inverted (false)                                                      | SWING_DISABLED (0, OFF), SWING_ENABLED (1, ON)                                                              |
 |                      |                             | TargetTiltAngle             | Dimmer, Number                          | Number Item = target angle of slats (-90 to +90). Dimmer Item =  the percentage of openness (0%-100%)                                                                                                                                                                                                                                                         |                                                                       |                                                                                                             |
 | SmartSpeaker         |                             |                             |                                         | Smart speaker accessory with Play/Stop/Pause control                                                                                                                                                                                                                                                                                                          |                                                                       |                                                                                                             |
@@ -863,23 +854,19 @@ Enums that are linked to Switches or Contacts have an `inverted` param that will
 |                      | TargetMediaState            |                             | Number, String                          | Target smart speaker state                                                                                                                                                                                                                                                                                                                                    |                                                                       | PLAY (0), PAUSE (1), STOP (2)                                                                               |
 |                      |                             | ConfiguredName              | String                                  | Name of the speaker accessory configured in iOS Home app. User can rename the speaker in iOS Home app and this characteristic can be used to reflect change in openHAB and sync name changes from openHAB to Home app.                                                                                                                                        |                                                                       |                                                                                                             |
 |                      |                             | Mute                        | Contact, Switch                         | Mute indication. ON/OPEN = speaker is muted                                                                                                                                                                                                                                                                                                                   | inverted (false)                                                      |                                                                                                             |
-|                      |                             | Name                        | String                                  | Name of the speaker accessory                                                                                                                                                                                                                                                                                                                                 |                                                                       |                                                                                                             |
 |                      |                             | Volume                      | Number                                  | Speaker volume from 0% to 100%                                                                                                                                                                                                                                                                                                                                |                                                                       |                                                                                                             |
 | SmokeSensor          |                             |                             |                                         | Smoke Sensor                                                                                                                                                                                                                                                                                                                                                  |                                                                       |                                                                                                             |
 |                      | SmokeDetectedState          |                             | Contact, Dimmer, Number, String, Switch | Smoke sensor state                                                                                                                                                                                                                                                                                                                                            | inverted (false)                                                      | NOT_DETECTED (0, OFF, CLOSED), DETECTED (1, ON, OPEN)                                                       |
 |                      |                             | ActiveStatus                | Contact, Switch                         | Working status                                                                                                                                                                                                                                                                                                                                                |                                                                       |                                                                                                             |
 |                      |                             | BatteryLowStatus            | Contact, Number, Switch                 | Battery status                                                                                                                                                                                                                                                                                                                                                | inverted (false), lowThreshold (20)                                   |                                                                                                             |
 |                      |                             | FaultStatus                 | Contact, Number, String, Switch         | Fault status                                                                                                                                                                                                                                                                                                                                                  | inverted (false)                                                      | NO_FAULT (0, OFF, CLOSED), GENERAL_FAULT (1, ON, OPEN)                                                      |
-|                      |                             | Name                        | String                                  | Name of the sensor                                                                                                                                                                                                                                                                                                                                            |                                                                       |                                                                                                             |
 |                      |                             | TamperedStatus              | Contact, Number, String, Switch         | Tampered status                                                                                                                                                                                                                                                                                                                                               | inverted (false)                                                      | NOT_TAMPERED (0, OFF, CLOSED), TAMPERED (1, ON, OPEN)                                                       |
 | Speaker              |                             |                             |                                         | Speaker accessory                                                                                                                                                                                                                                                                                                                                             |                                                                       |                                                                                                             |
 |                      | Mute                        |                             | Contact, Dimmer, Switch                 | Mute indication. ON/OPEN = speaker is muted                                                                                                                                                                                                                                                                                                                   | inverted (false)                                                      |                                                                                                             |
 |                      |                             | Active                      | Contact, Dimmer, Number, String, Switch | Accessory current working status                                                                                                                                                                                                                                                                                                                              | inverted (false)                                                      | INACTIVE (0, OFF), ACTIVE (1, ON)                                                                           |
-|                      |                             | Name                        | String                                  | Name of the speaker accessory                                                                                                                                                                                                                                                                                                                                 |                                                                       |                                                                                                             |
 |                      |                             | Volume                      | Number                                  | Speaker volume from 0% to 100%                                                                                                                                                                                                                                                                                                                                |                                                                       |                                                                                                             |
 | Switchable           |                             |                             |                                         | An accessory that can be turned off and on. While similar to a lightbulb, this will be presented differently in the Siri grammar and iOS apps                                                                                                                                                                                                                 |                                                                       |                                                                                                             |
 |                      | OnState                     |                             | Dimmer, Switch                          | State of the switch - ON/OFF                                                                                                                                                                                                                                                                                                                                  |                                                                       |                                                                                                             |
-|                      |                             | Name                        | String                                  | Name of the switch                                                                                                                                                                                                                                                                                                                                            |                                                                       |                                                                                                             |
 | Television           |                             |                             |                                         | Television accessory with inputs                                                                                                                                                                                                                                                                                                                              |                                                                       |                                                                                                             |
 |                      | Active                      |                             | Contact, Dimmer, Number, String, Switch | State of the television (on/off)                                                                                                                                                                                                                                                                                                                              | inverted (false)                                                      | INACTIVE (0, OFF), ACTIVE (1, ON)                                                                           |
 |                      |                             | ActiveIdentifier            | Number                                  | The input that is currently active (based on its identifier). Can also be configured via metadata, e.g. [ActiveIdentifier=1]                                                                                                                                                                                                                                  |                                                                       |                                                                                                             |
@@ -887,7 +874,6 @@ Enums that are linked to Switches or Contacts have an `inverted` param that will
 |                      |                             | ClosedCaptions              | Contact, Dimmer, Number, String, Switch | Indicates closed captions are enabled. Can also be configured via metadata, e.g. [ClosedCaptions=true]                                                                                                                                                                                                                                                        | inverted (false)                                                      | DISABLED (0, OFF), ENABLED (1, ON)                                                                          |
 |                      |                             | ConfiguredName              | String                                  | Name of the television accessory configured in the iOS Home app. User can rename the television in iOS Home app and this characteristic can be used to reflect change in openHAB and sync name changes from openHAB to Home app.                                                                                                                              |                                                                       |                                                                                                             |
 |                      |                             | CurrentMediaState           | Number, String                          | Current television state.                                                                                                                                                                                                                                                                                                                                     |                                                                       | PLAY (0), PAUSE (1), STOP (2), UNKNOWN (3)                                                                  |
-|                      |                             | Name                        | String                                  | Name of the television accessory                                                                                                                                                                                                                                                                                                                              |                                                                       |                                                                                                             |
 |                      |                             | PictureMode                 | Number, String                          | Selected picture mode.                                                                                                                                                                                                                                                                                                                                        |                                                                       | OTHER (0), STANDARD (1), CALIBRATED (2), CALIBRATED_DARK (3), VIVID (4), GAME (5), COMPUTER (6), CUSTOM (7) |
 |                      |                             | PowerMode                   | Switch, Number, String                  | This oddly named characteristic will receive an ON command when the user requests to open the TV's menu.                                                                                                                                                                                                                                                      | inverted (false)                                                      | SHOW (0, ON), HIDE (1, OFF)                                                                                 |
 |                      |                             | RemoteKey                   | String                                  | Receives a keypress event.                                                                                                                                                                                                                                                                                                                                    |                                                                       |                                                                                                             |
@@ -904,7 +890,6 @@ Enums that are linked to Switches or Contacts have an `inverted` param that will
 |                      |                             | ActiveStatus                | Contact, Switch                         | Working status                                                                                                                                                                                                                                                                                                                                                |                                                                       |                                                                                                             |
 |                      |                             | BatteryLowStatus            | Contact, Number, Switch                 | Battery status                                                                                                                                                                                                                                                                                                                                                | inverted (false), lowThreshold (20)                                   |                                                                                                             |
 |                      |                             | FaultStatus                 | Contact, Number, String, Switch         | Fault status                                                                                                                                                                                                                                                                                                                                                  | inverted (false)                                                      | NO_FAULT (0, OFF, CLOSED), GENERAL_FAULT (1, ON, OPEN)                                                      |
-|                      |                             | Name                        | String                                  | Name of the sensor                                                                                                                                                                                                                                                                                                                                            |                                                                       |                                                                                                             |
 |                      |                             | TamperedStatus              | Contact, Number, String, Switch         | Tampered status                                                                                                                                                                                                                                                                                                                                               | inverted (false)                                                      | NOT_TAMPERED (0, OFF, CLOSED), TAMPERED (1, ON, OPEN)                                                       |
 | Thermostat           |                             |                             |                                         | A thermostat requires all mandatory characteristics defined below                                                                                                                                                                                                                                                                                             |                                                                       |                                                                                                             |
 |                      | CurrentHeatingCoolingMode   |                             | Number, String                          | Current heating cooling mode                                                                                                                                                                                                                                                                                                                                  |                                                                       | OFF (0, OFF), HEAT (1, ON), COOL (2)                                                                        |
@@ -913,20 +898,17 @@ Enums that are linked to Switches or Contacts have an `inverted` param that will
 |                      | TargetTemperature           |                             | Number                                  | Target temperature.                                                                                                                                                                                                                                                                                                                                           | minValue (10), maxValue (38), step (0.1)                              |                                                                                                             |
 |                      |                             | CoolingThresholdTemperature | Number                                  | Maximum temperature that must be reached before cooling is turned on                                                                                                                                                                                                                                                                                          | minValue (10), maxValue (35), step (0.1)                              |                                                                                                             |
 |                      |                             | HeatingThresholdTemperature | Number                                  | Minimum temperature that must be reached before heating is turned on                                                                                                                                                                                                                                                                                          | minValue (0), maxValue (25), step (0.1)                               |                                                                                                             |
-|                      |                             | Name                        | String                                  | Name of the thermostat                                                                                                                                                                                                                                                                                                                                        |                                                                       |                                                                                                             |
 |                      |                             | RelativeHumidity            | Number                                  | Relative humidity in % between 0 and 100.                                                                                                                                                                                                                                                                                                                     |                                                                       |                                                                                                             |
 | Valve                |                             |                             |                                         | Valve                                                                                                                                                                                                                                                                                                                                                         | ValveType = ["Generic", "Irrigation", "Shower", "Faucet"] ("Generic") |                                                                                                             |
 |                      | ActiveStatus                |                             | Dimmer, Switch                          | Accessory current working status. A value of "ON"/"OPEN" indicates that the accessory is active and is functioning without any errors.                                                                                                                                                                                                                        |                                                                       |                                                                                                             |
 |                      | InUseStatus                 |                             | Contact, Dimmer, Switch                 | Indicates whether fluid flowing through the valve. A value of "ON"/"OPEN" indicates that fluid is flowing.                                                                                                                                                                                                                                                    | inverted (false)                                                      |                                                                                                             |
 |                      |                             | Duration                    | Number                                  | Defines how long a valve should be set to Ê¼In Useʼ in second.                                                                                                                                                                                                                                                                                                 | homekitDefaultDuration = {default duration in seconds}                |                                                                                                             |
 |                      |                             | FaultStatus                 | Contact, Number, String, Switch         | Fault status                                                                                                                                                                                                                                                                                                                                                  | inverted (false)                                                      | NO_FAULT (0, OFF, CLOSED), GENERAL_FAULT (1, ON, OPEN)                                                      |
-|                      |                             | Name                        | String                                  | Name of the valve                                                                                                                                                                                                                                                                                                                                             |                                                                       |                                                                                                             |
 |                      |                             | RemainingDuration           | Number                                  | Describes the remaining duration on the accessory. the remaining duration increases/decreases from the accessoryʼs usual countdown. i.e. changes from 90 to 80 in a second.                                                                                                                                                                                   |                                                                       |                                                                                                             |
 | Window               |                             |                             |                                         | Motorized window. One Rollershutter item covers all mandatory characteristics. see examples below.                                                                                                                                                                                                                                                            |                                                                       |                                                                                                             |
 |                      | CurrentPosition             |                             | Dimmer, Number, Rollershutter           | Current position of motorized window                                                                                                                                                                                                                                                                                                                          |                                                                       |                                                                                                             |
 |                      | PositionState               |                             | Number, Rollershutter, String           | Position state. If no state is provided, "STOPPED" is used.                                                                                                                                                                                                                                                                                                   |                                                                       | DECREASING (0), INCREASING (1), STOPPED (2)                                                                 |
 |                      | TargetPosition              |                             | Dimmer, Number, Rollershutter           | Target position of motorized window                                                                                                                                                                                                                                                                                                                           |                                                                       |                                                                                                             |
-|                      |                             | Name                        | String                                  | Name of the motorized window                                                                                                                                                                                                                                                                                                                                  |                                                                       |                                                                                                             |
 |                      |                             | HoldPosition                | Rollershutter, Switch                   | Motorized door should stop at its current position. ON is sent to Switch items. STOP is sent to Rollershutter items. Only supported by 3rd party Home apps (such as Elgato Eve)                                                                                                                                                                               |                                                                       |                                                                                                             |
 |                      |                             | ObstructionStatus           | Contact, Dimmer, Switch                 | Current status of obstruction sensor. ON-obstruction detected, OFF - no obstruction                                                                                                                                                                                                                                                                           |                                                                       |                                                                                                             |
 | WindowCovering       |                             |                             |                                         | Window covering / blinds. One Rollershutter item covers all mandatory characteristics. see examples below.                                                                                                                                                                                                                                                    |                                                                       |                                                                                                             |
@@ -936,7 +918,6 @@ Enums that are linked to Switches or Contacts have an `inverted` param that will
 |                      |                             | CurrentHorizontalTiltAngle  | Dimmer, Number                          | Number Item = current angle of horizontal slats. values -90 to 90. A value of 0 indicates that the slats are rotated to a fully open position. A value of -90 indicates that the slats are rotated all the way in a direction where the user-facing edge is higher than the window-facing edge. Dimmer Item =  the percentage of openness (0%-100%)           |                                                                       |                                                                                                             |
 |                      |                             | CurrentVerticalTiltAngle    | Dimmer, Number                          | Number Item = current angle of vertical slats (-90 to +90) . Dimmer Item =  the percentage of openness (0%-100%)                                                                                                                                                                                                                                              |                                                                       |                                                                                                             |
 |                      |                             | HoldPosition                | Rollershutter, Switch                   | Motorized door should stop at its current position. ON is sent to Switch items. STOP is sent to Rollershutter items. Only supported by 3rd party Home apps (such as Elgato Eve)                                                                                                                                                                               |                                                                       |                                                                                                             |
-|                      |                             | Name                        | String                                  | Name of the windows covering                                                                                                                                                                                                                                                                                                                                  |                                                                       |                                                                                                             |
 |                      |                             | ObstructionStatus           | Contact, Dimmer, Switch                 | Current status of obstruction sensor. ON-obstruction detected, OFF - no obstruction                                                                                                                                                                                                                                                                           |                                                                       |                                                                                                             |
 |                      |                             | TargetHorizontalTiltAngle   | Dimmer, Number                          | Number Item = target angle of horizontal slats (-90 to +90). Dimmer Item =  the percentage of openness (0%-100%)                                                                                                                                                                                                                                              |                                                                       |                                                                                                             |
 |                      |                             | TargetVerticalTiltAngle     | Dimmer, Number                          | Number Item = target angle of vertical slats. Dimmer Item =  the percentage of openness (0%-100%)                                                                                                                                                                                                                                                             |                                                                       |                                                                                                             |
index 73b23312f09b1d019e5ae85815325558a778f228..80d3e91cd2c1df063d495aca5c551d91047b8839 100644 (file)
@@ -22,7 +22,7 @@
     <dependency>
       <groupId>io.github.hap-java</groupId>
       <artifactId>hap</artifactId>
-      <version>2.0.5</version>
+      <version>2.0.6</version>
       <scope>compile</scope>
     </dependency>
     <dependency>
index 9b5ee21d5b38ad8bd97debe0e04fef912831e1af..8da0410312f220423388757c10577d955e07a957 100644 (file)
@@ -12,7 +12,6 @@
  */
 package org.openhab.io.homekit.internal;
 
-import java.lang.reflect.InvocationTargetException;
 import java.time.Clock;
 import java.time.Duration;
 import java.util.ArrayList;
@@ -48,7 +47,6 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import io.github.hapjava.accessories.HomekitAccessory;
-import io.github.hapjava.characteristics.impl.common.NameCharacteristic;
 import io.github.hapjava.server.impl.HomekitRoot;
 
 /**
@@ -476,20 +474,7 @@ public class HomekitChangeListener implements ItemRegistryChangeListener {
                         try {
                             final AbstractHomekitAccessoryImpl additionalAccessory = HomekitAccessoryFactory
                                     .create(additionalTaggedItem, metadataRegistry, updater, settings);
-                            // Secondary accessories that don't explicitly specify a name will implicitly
-                            // get a name characteristic based on the item's name
-                            if (!additionalAccessory.getCharacteristic(HomekitCharacteristicType.NAME).isPresent()) {
-                                try {
-                                    additionalAccessory.addCharacteristic(
-                                            new NameCharacteristic(() -> additionalAccessory.getName()));
-                                } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException e) {
-                                    // This should never happen; all services should support NameCharacteristic as an
-                                    // optional Characteristic.
-                                    // If HAP-Java defined a service that doesn't support
-                                    // addOptionalCharacteristic(NameCharacteristic), then it's a bug there, and we're
-                                    // just going to ignore the exception here.
-                                }
-                            }
+                            additionalAccessory.promoteNameCharacteristic();
                             accessory.getServices().add(additionalAccessory.getPrimaryService());
                         } catch (HomekitException e) {
                             logger.warn("Cannot create additional accessory {}", additionalTaggedItem);
index b8b83f630dbd272ab12066749822d078ce3f780b..556b975facad138925d5afbe3185d7ede890664e 100644 (file)
@@ -27,7 +27,15 @@ public enum HomekitCharacteristicType {
      * It is illegal to have a characteristic type also be a device type
      */
     EMPTY("Empty"), // used in case only accessory type but no characteristic provided
+
     NAME("Name"),
+    MANUFACTURER("Manufacturer"),
+    MODEL("Model"),
+    SERIAL_NUMBER("SerialNumber"),
+    FIRMWARE_REVISION("FirmwareRevision"),
+    HARDWARE_REVISION("HardwareRevision"),
+    IDENTIFY("Identify"),
+
     BATTERY_LOW_STATUS("BatteryLowStatus"),
     ACTIVE_STATUS("ActiveStatus"),
     ISCONFIGURED("IsConfigured"),
index b8f13071e45b60c0c44a9ecef6cc1ecbbf3d7903..228de13211e489cb85e888a0711b45c4af1933d4 100644 (file)
@@ -45,8 +45,16 @@ import io.github.hapjava.accessories.HomekitAccessory;
 import io.github.hapjava.characteristics.Characteristic;
 import io.github.hapjava.characteristics.CharacteristicEnum;
 import io.github.hapjava.characteristics.HomekitCharacteristicChangeCallback;
+import io.github.hapjava.characteristics.impl.accessoryinformation.FirmwareRevisionCharacteristic;
+import io.github.hapjava.characteristics.impl.accessoryinformation.HardwareRevisionCharacteristic;
+import io.github.hapjava.characteristics.impl.accessoryinformation.IdentifyCharacteristic;
+import io.github.hapjava.characteristics.impl.accessoryinformation.ManufacturerCharacteristic;
+import io.github.hapjava.characteristics.impl.accessoryinformation.ModelCharacteristic;
+import io.github.hapjava.characteristics.impl.accessoryinformation.SerialNumberCharacteristic;
 import io.github.hapjava.characteristics.impl.base.BaseCharacteristic;
+import io.github.hapjava.characteristics.impl.common.NameCharacteristic;
 import io.github.hapjava.services.Service;
+import io.github.hapjava.services.impl.AccessoryInformationService;
 
 /**
  * Abstract class for Homekit Accessory implementations, this provides the
@@ -62,6 +70,7 @@ public abstract class AbstractHomekitAccessoryImpl implements HomekitAccessory {
     private final HomekitSettings settings;
     private final List<Service> services;
     private final Map<Class<? extends Characteristic>, Characteristic> rawCharacteristics;
+    private boolean isLinkedService = false;
 
     public AbstractHomekitAccessoryImpl(HomekitTaggedItem accessory, List<HomekitTaggedItem> characteristics,
             HomekitAccessoryUpdater updater, HomekitSettings settings) {
@@ -88,6 +97,52 @@ public abstract class AbstractHomekitAccessoryImpl implements HomekitAccessory {
      * @throws HomekitException
      */
     public void init() throws HomekitException {
+        // initialize the AccessoryInformation Service with defaults if not specified
+        if (!rawCharacteristics.containsKey(NameCharacteristic.class)) {
+            rawCharacteristics.put(NameCharacteristic.class, new NameCharacteristic(() -> {
+                return CompletableFuture.completedFuture(accessory.getItem().getLabel());
+            }));
+        }
+
+        if (!isLinkedService()) {
+            if (!rawCharacteristics.containsKey(IdentifyCharacteristic.class)) {
+                rawCharacteristics.put(IdentifyCharacteristic.class, new IdentifyCharacteristic(v -> {
+                }));
+            }
+            if (!rawCharacteristics.containsKey(ManufacturerCharacteristic.class)) {
+                rawCharacteristics.put(ManufacturerCharacteristic.class, new ManufacturerCharacteristic(() -> {
+                    return CompletableFuture.completedFuture("none");
+                }));
+            }
+            if (!rawCharacteristics.containsKey(ModelCharacteristic.class)) {
+                rawCharacteristics.put(ModelCharacteristic.class, new ModelCharacteristic(() -> {
+                    return CompletableFuture.completedFuture("none");
+                }));
+            }
+            if (!rawCharacteristics.containsKey(SerialNumberCharacteristic.class)) {
+                rawCharacteristics.put(SerialNumberCharacteristic.class, new SerialNumberCharacteristic(() -> {
+                    return CompletableFuture.completedFuture(accessory.getItem().getName());
+                }));
+            }
+            if (!rawCharacteristics.containsKey(FirmwareRevisionCharacteristic.class)) {
+                rawCharacteristics.put(FirmwareRevisionCharacteristic.class, new FirmwareRevisionCharacteristic(() -> {
+                    return CompletableFuture.completedFuture("none");
+                }));
+            }
+
+            var service = new AccessoryInformationService(getCharacteristic(IdentifyCharacteristic.class).get(),
+                    getCharacteristic(ManufacturerCharacteristic.class).get(),
+                    getCharacteristic(ModelCharacteristic.class).get(),
+                    getCharacteristic(NameCharacteristic.class).get(),
+                    getCharacteristic(SerialNumberCharacteristic.class).get(),
+                    getCharacteristic(FirmwareRevisionCharacteristic.class).get());
+
+            getCharacteristic(HardwareRevisionCharacteristic.class)
+                    .ifPresent(c -> service.addOptionalCharacteristic(c));
+
+            // make sure this is the first service
+            services.add(0, service);
+        }
     }
 
     /**
@@ -99,6 +154,20 @@ public abstract class AbstractHomekitAccessoryImpl implements HomekitAccessory {
         return false;
     }
 
+    /**
+     * Sets if this accessory is being used as a linked service.
+     */
+    public void setIsLinkedService(boolean value) {
+        isLinkedService = value;
+    }
+
+    /**
+     * @return If this accessory is being used as a linked service.
+     */
+    public boolean isLinkedService() {
+        return isLinkedService;
+    }
+
     /**
      * @return If this accessory is only valid as a linked service, not as a standalone accessory.
      */
@@ -118,32 +187,36 @@ public abstract class AbstractHomekitAccessoryImpl implements HomekitAccessory {
 
     @Override
     public CompletableFuture<String> getName() {
-        return CompletableFuture.completedFuture(accessory.getItem().getLabel());
+        return getCharacteristic(NameCharacteristic.class).get().getValue();
     }
 
     @Override
     public CompletableFuture<String> getManufacturer() {
-        return CompletableFuture.completedFuture("none");
+        return getCharacteristic(ManufacturerCharacteristic.class).get().getValue();
     }
 
     @Override
     public CompletableFuture<String> getModel() {
-        return CompletableFuture.completedFuture("none");
+        return getCharacteristic(ModelCharacteristic.class).get().getValue();
     }
 
     @Override
     public CompletableFuture<String> getSerialNumber() {
-        return CompletableFuture.completedFuture(accessory.getItem().getName());
+        return getCharacteristic(SerialNumberCharacteristic.class).get().getValue();
     }
 
     @Override
     public CompletableFuture<String> getFirmwareRevision() {
-        return CompletableFuture.completedFuture("none");
+        return getCharacteristic(FirmwareRevisionCharacteristic.class).get().getValue();
     }
 
     @Override
     public void identify() {
-        // We're not going to support this for now
+        try {
+            getCharacteristic(IdentifyCharacteristic.class).get().setValue(true);
+        } catch (Exception e) {
+            // ignore
+        }
     }
 
     public HomekitTaggedItem getRootAccessory() {
@@ -356,6 +429,31 @@ public abstract class AbstractHomekitAccessoryImpl implements HomekitAccessory {
         }
     }
 
+    /**
+     * Takes the NameCharacteristic that normally exists on the AccessoryInformationService,
+     * and puts it on the primary service.
+     */
+    public void promoteNameCharacteristic() {
+        var characteristic = getCharacteristic(NameCharacteristic.class);
+        if (!characteristic.isPresent()) {
+            return;
+        }
+
+        var service = getPrimaryService();
+        if (service != null) {
+            try {
+                // find the corresponding add method at service and call it.
+                service.getClass().getMethod("addOptionalCharacteristic", NameCharacteristic.class).invoke(service,
+                        characteristic.get());
+            } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException e) {
+                // This should never happen; all services should support NameCharacteristic as an optional
+                // Characteristic.
+                // If HAP-Java defined a service that doesn't support addOptionalCharacteristic(NameCharacteristic),
+                // Then it's a bug there, and we're just going to ignore the exception here.
+            }
+        }
+    }
+
     @NonNullByDefault
     public <T> Optional<T> getCharacteristic(Class<? extends T> klazz) {
         return Optional.ofNullable((T) rawCharacteristics.get(klazz));
index 29a8cd44da0b4cf18fe212e4df9d71cbf2cc657d..9968d3e4db2c481f55872bde08db700a1daf8051 100644 (file)
@@ -52,7 +52,6 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import io.github.hapjava.characteristics.Characteristic;
-import io.github.hapjava.characteristics.impl.common.NameCharacteristic;
 
 /**
  * Creates a HomekitAccessory for a given HomekitTaggedItem.
@@ -211,13 +210,14 @@ public class HomekitAccessoryFactory {
                             taggedItem.getName());
                     throw new HomekitException("Circular accessory references");
                 }
-                ancestorServices.add(taggedItem);
                 accessoryImpl = accessoryImplClass.getConstructor(HomekitTaggedItem.class, List.class,
                         HomekitAccessoryUpdater.class, HomekitSettings.class)
                         .newInstance(taggedItem, foundCharacteristics, updater, settings);
                 addOptionalCharacteristics(taggedItem, accessoryImpl, metadataRegistry);
                 addOptionalMetadataCharacteristics(taggedItem, accessoryImpl);
+                accessoryImpl.setIsLinkedService(!ancestorServices.isEmpty());
                 accessoryImpl.init();
+                ancestorServices.add(taggedItem);
                 addLinkedServices(taggedItem, accessoryImpl, metadataRegistry, updater, settings, ancestorServices);
                 return accessoryImpl;
             } else {
@@ -467,15 +467,7 @@ public class HomekitAccessoryFactory {
             final var itemProxy = new HomekitOHItemProxy(groupMember);
             final var subTaggedItem = new HomekitTaggedItem(itemProxy, accessoryType, itemConfiguration);
             final var subAccessory = create(subTaggedItem, metadataRegistry, updater, settings, ancestorServices);
-
-            try {
-                subAccessory.addCharacteristic(new NameCharacteristic(() -> subAccessory.getName()));
-            } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException e) {
-                // This should never happen; all services should support NameCharacteristic as an optional
-                // Characteristic.
-                // If HAP-Java defined a service that doesn't support addOptionalCharacteristic(NameCharacteristic),
-                // Then it's a bug there, and we're just going to ignore the exception here.
-            }
+            subAccessory.promoteNameCharacteristic();
 
             if (subAccessory.isLinkable(accessory)) {
                 accessory.getPrimaryService().addLinkedService(subAccessory.getPrimaryService());
index a95817337ba33aa3922df6db122de8f5435aae70..36607ffd154d939995acb2049d5ea49f3b6ca01e 100644 (file)
@@ -19,6 +19,7 @@ import java.util.Map;
 import java.util.concurrent.CompletableFuture;
 
 import org.openhab.io.homekit.internal.HomekitAccessoryUpdater;
+import org.openhab.io.homekit.internal.HomekitException;
 import org.openhab.io.homekit.internal.HomekitSettings;
 import org.openhab.io.homekit.internal.HomekitTaggedItem;
 
@@ -39,6 +40,11 @@ public class HomekitAirQualitySensorImpl extends AbstractHomekitAccessoryImpl im
             HomekitAccessoryUpdater updater, HomekitSettings settings) throws IncompleteAccessoryException {
         super(taggedItem, mandatoryCharacteristics, updater, settings);
         qualityStateMapping = createMapping(AIR_QUALITY, AirQualityEnum.class);
+    }
+
+    @Override
+    public void init() throws HomekitException {
+        super.init();
         getServices().add(new AirQualityService(this));
     }
 
index 62ae9bbe80fe4093fcc296d2efc4432ead3872c8..a8b33ca0f8ccf16c0123e8e4bd68990768cd4681 100644 (file)
@@ -19,6 +19,7 @@ import java.util.concurrent.CompletableFuture;
 
 import org.eclipse.jdt.annotation.NonNullByDefault;
 import org.openhab.io.homekit.internal.HomekitAccessoryUpdater;
+import org.openhab.io.homekit.internal.HomekitException;
 import org.openhab.io.homekit.internal.HomekitSettings;
 import org.openhab.io.homekit.internal.HomekitTaggedItem;
 
@@ -39,6 +40,11 @@ class HomekitBasicFanImpl extends AbstractHomekitAccessoryImpl implements BasicF
             HomekitAccessoryUpdater updater, HomekitSettings settings) throws IncompleteAccessoryException {
         super(taggedItem, mandatoryCharacteristics, updater, settings);
         onReader = createBooleanReader(ON_STATE);
+    }
+
+    @Override
+    public void init() throws HomekitException {
+        super.init();
         this.getServices().add(new BasicFanService(this));
     }
 
index 7fdf75346df36d96d97965ffa27592bd1f6bdf3e..4c9529fd3ce2420e2491d808b59cc044718edc15 100644 (file)
@@ -24,6 +24,7 @@ import org.eclipse.jdt.annotation.Nullable;
 import org.openhab.core.library.types.DecimalType;
 import org.openhab.io.homekit.internal.HomekitAccessoryUpdater;
 import org.openhab.io.homekit.internal.HomekitCharacteristicType;
+import org.openhab.io.homekit.internal.HomekitException;
 import org.openhab.io.homekit.internal.HomekitSettings;
 import org.openhab.io.homekit.internal.HomekitTaggedItem;
 
@@ -56,6 +57,11 @@ public class HomekitBatteryImpl extends AbstractHomekitAccessoryImpl implements
         if (isChargeable) {
             chargingBatteryReader = createBooleanReader(BATTERY_CHARGING_STATE);
         }
+    }
+
+    @Override
+    public void init() throws HomekitException {
+        super.init();
         getServices().add(new BatteryService(this));
     }
 
index 66886a6b6e146de75a796cea4c3de6105925c0b2..44b18ad4c21fc10b64388aab3366a5293e613b74 100644 (file)
@@ -19,6 +19,7 @@ import java.util.Map;
 import java.util.concurrent.CompletableFuture;
 
 import org.openhab.io.homekit.internal.HomekitAccessoryUpdater;
+import org.openhab.io.homekit.internal.HomekitException;
 import org.openhab.io.homekit.internal.HomekitSettings;
 import org.openhab.io.homekit.internal.HomekitTaggedItem;
 
@@ -40,6 +41,11 @@ public class HomekitCarbonDioxideSensorImpl extends AbstractHomekitAccessoryImpl
             throws IncompleteAccessoryException {
         super(taggedItem, mandatoryCharacteristics, updater, settings);
         mapping = createMapping(CARBON_DIOXIDE_DETECTED_STATE, CarbonDioxideDetectedEnum.class);
+    }
+
+    @Override
+    public void init() throws HomekitException {
+        super.init();
         getServices().add(new CarbonDioxideSensorService(this));
     }
 
index e97e51113e4e3aba83ae95420133d280d6ffd283..f1235a4c0fecfeb57eadc9a91ae6ef4336b396c1 100644 (file)
@@ -19,6 +19,7 @@ import java.util.Map;
 import java.util.concurrent.CompletableFuture;
 
 import org.openhab.io.homekit.internal.HomekitAccessoryUpdater;
+import org.openhab.io.homekit.internal.HomekitException;
 import org.openhab.io.homekit.internal.HomekitSettings;
 import org.openhab.io.homekit.internal.HomekitTaggedItem;
 
@@ -40,6 +41,11 @@ public class HomekitCarbonMonoxideSensorImpl extends AbstractHomekitAccessoryImp
             throws IncompleteAccessoryException {
         super(taggedItem, mandatoryCharacteristics, updater, settings);
         mapping = createMapping(CARBON_MONOXIDE_DETECTED_STATE, CarbonMonoxideDetectedEnum.class);
+    }
+
+    @Override
+    public void init() throws HomekitException {
+        super.init();
         getServices().add(new CarbonMonoxideSensorService(this));
     }
 
index 1fb51259cc2414050ca23f941d6fd9660575a770..e4105859a0564c721c5dd83d3a78cb95e13e98cb 100644 (file)
@@ -68,6 +68,12 @@ import io.github.hapjava.characteristics.Characteristic;
 import io.github.hapjava.characteristics.CharacteristicEnum;
 import io.github.hapjava.characteristics.ExceptionalConsumer;
 import io.github.hapjava.characteristics.HomekitCharacteristicChangeCallback;
+import io.github.hapjava.characteristics.impl.accessoryinformation.FirmwareRevisionCharacteristic;
+import io.github.hapjava.characteristics.impl.accessoryinformation.HardwareRevisionCharacteristic;
+import io.github.hapjava.characteristics.impl.accessoryinformation.IdentifyCharacteristic;
+import io.github.hapjava.characteristics.impl.accessoryinformation.ManufacturerCharacteristic;
+import io.github.hapjava.characteristics.impl.accessoryinformation.ModelCharacteristic;
+import io.github.hapjava.characteristics.impl.accessoryinformation.SerialNumberCharacteristic;
 import io.github.hapjava.characteristics.impl.airquality.NitrogenDioxideDensityCharacteristic;
 import io.github.hapjava.characteristics.impl.airquality.OzoneDensityCharacteristic;
 import io.github.hapjava.characteristics.impl.airquality.PM10DensityCharacteristic;
@@ -165,6 +171,11 @@ public class HomekitCharacteristicFactory {
     private static final Map<HomekitCharacteristicType, BiFunction<HomekitTaggedItem, HomekitAccessoryUpdater, Characteristic>> OPTIONAL = new HashMap<>() {
         {
             put(NAME, HomekitCharacteristicFactory::createNameCharacteristic);
+            put(MODEL, HomekitCharacteristicFactory::createModelCharacteristic);
+            put(MANUFACTURER, HomekitCharacteristicFactory::createManufacturerCharacteristic);
+            put(SERIAL_NUMBER, HomekitCharacteristicFactory::createSerialNumberCharacteristic);
+            put(FIRMWARE_REVISION, HomekitCharacteristicFactory::createFirmwareRevisionCharacteristic);
+            put(HARDWARE_REVISION, HomekitCharacteristicFactory::createHardwareRevisionCharacteristic);
             put(BATTERY_LOW_STATUS, HomekitCharacteristicFactory::createStatusLowBatteryCharacteristic);
             put(FAULT_STATUS, HomekitCharacteristicFactory::createStatusFaultCharacteristic);
             put(TAMPERED_STATUS, HomekitCharacteristicFactory::createStatusTamperedCharacteristic);
@@ -227,6 +238,7 @@ public class HomekitCharacteristicFactory {
             put(CURRENT_MEDIA_STATE, HomekitCharacteristicFactory::createCurrentMediaStateCharacteristic);
             put(TARGET_MEDIA_STATE, HomekitCharacteristicFactory::createTargetMediaStateCharacteristic);
             put(MUTE, HomekitCharacteristicFactory::createMuteCharacteristic);
+            put(IDENTIFY, HomekitCharacteristicFactory::createIdentifyCharacteristic);
         }
     };
 
@@ -632,6 +644,46 @@ public class HomekitCharacteristicFactory {
         });
     }
 
+    private static ModelCharacteristic createModelCharacteristic(HomekitTaggedItem taggedItem,
+            HomekitAccessoryUpdater updater) {
+        return new ModelCharacteristic(() -> {
+            final State state = taggedItem.getItem().getState();
+            return CompletableFuture.completedFuture(state instanceof UnDefType ? "" : state.toString());
+        });
+    }
+
+    private static ManufacturerCharacteristic createManufacturerCharacteristic(HomekitTaggedItem taggedItem,
+            HomekitAccessoryUpdater updater) {
+        return new ManufacturerCharacteristic(() -> {
+            final State state = taggedItem.getItem().getState();
+            return CompletableFuture.completedFuture(state instanceof UnDefType ? "" : state.toString());
+        });
+    }
+
+    private static SerialNumberCharacteristic createSerialNumberCharacteristic(HomekitTaggedItem taggedItem,
+            HomekitAccessoryUpdater updater) {
+        return new SerialNumberCharacteristic(() -> {
+            final State state = taggedItem.getItem().getState();
+            return CompletableFuture.completedFuture(state instanceof UnDefType ? "" : state.toString());
+        });
+    }
+
+    private static FirmwareRevisionCharacteristic createFirmwareRevisionCharacteristic(HomekitTaggedItem taggedItem,
+            HomekitAccessoryUpdater updater) {
+        return new FirmwareRevisionCharacteristic(() -> {
+            final State state = taggedItem.getItem().getState();
+            return CompletableFuture.completedFuture(state instanceof UnDefType ? "" : state.toString());
+        });
+    }
+
+    private static HardwareRevisionCharacteristic createHardwareRevisionCharacteristic(HomekitTaggedItem taggedItem,
+            HomekitAccessoryUpdater updater) {
+        return new HardwareRevisionCharacteristic(() -> {
+            final State state = taggedItem.getItem().getState();
+            return CompletableFuture.completedFuture(state instanceof UnDefType ? "" : state.toString());
+        });
+    }
+
     private static HoldPositionCharacteristic createHoldPositionCharacteristic(HomekitTaggedItem taggedItem,
             HomekitAccessoryUpdater updater) {
         final Item item = taggedItem.getBaseItem();
@@ -1054,7 +1106,7 @@ public class HomekitCharacteristicFactory {
     private static ResetFilterIndicationCharacteristic createFilterResetCharacteristic(HomekitTaggedItem taggedItem,
             HomekitAccessoryUpdater updater) {
         return new ResetFilterIndicationCharacteristic(
-                (value) -> ((SwitchItem) taggedItem.getItem()).send(OnOffType.ON));
+                (value) -> ((SwitchItem) taggedItem.getBaseItem()).send(OnOffType.ON));
     }
 
     private static ActiveCharacteristic createActiveCharacteristic(HomekitTaggedItem taggedItem,
@@ -1216,4 +1268,9 @@ public class HomekitCharacteristicFactory {
                 (value) -> taggedItem.send(OnOffType.from(value)), getSubscriber(taggedItem, MUTE, updater),
                 getUnsubscriber(taggedItem, MUTE, updater));
     }
+
+    private static IdentifyCharacteristic createIdentifyCharacteristic(HomekitTaggedItem taggedItem,
+            HomekitAccessoryUpdater updater) {
+        return new IdentifyCharacteristic((value) -> ((SwitchItem) taggedItem.getBaseItem()).send(OnOffType.ON));
+    }
 }
index be6e5955d50c4affea9d997ee1fc0dc85c6d25a7..3ff7c9a19169fda93e2363fccc606610b742caf4 100644 (file)
@@ -19,6 +19,7 @@ import java.util.Map;
 import java.util.concurrent.CompletableFuture;
 
 import org.openhab.io.homekit.internal.HomekitAccessoryUpdater;
+import org.openhab.io.homekit.internal.HomekitException;
 import org.openhab.io.homekit.internal.HomekitSettings;
 import org.openhab.io.homekit.internal.HomekitTaggedItem;
 
@@ -38,6 +39,11 @@ public class HomekitContactSensorImpl extends AbstractHomekitAccessoryImpl imple
             HomekitAccessoryUpdater updater, HomekitSettings settings) throws IncompleteAccessoryException {
         super(taggedItem, mandatoryCharacteristics, updater, settings);
         mapping = createMapping(CONTACT_SENSOR_STATE, ContactStateEnum.class);
+    }
+
+    @Override
+    public void init() throws HomekitException {
+        super.init();
         getServices().add(new ContactSensorService(this));
     }
 
index 507f6d24e5d99efc962589395e2c09cd04174447..021663004efa33d9c0e53d53ff3d428043985a76 100644 (file)
@@ -17,6 +17,7 @@ import java.util.concurrent.CompletableFuture;
 
 import org.eclipse.jdt.annotation.NonNullByDefault;
 import org.openhab.io.homekit.internal.HomekitAccessoryUpdater;
+import org.openhab.io.homekit.internal.HomekitException;
 import org.openhab.io.homekit.internal.HomekitSettings;
 import org.openhab.io.homekit.internal.HomekitTaggedItem;
 
@@ -35,6 +36,11 @@ public class HomekitDoorImpl extends AbstractHomekitPositionAccessoryImpl implem
     public HomekitDoorImpl(HomekitTaggedItem taggedItem, List<HomekitTaggedItem> mandatoryCharacteristics,
             HomekitAccessoryUpdater updater, HomekitSettings settings) {
         super(taggedItem, mandatoryCharacteristics, updater, settings);
+    }
+
+    @Override
+    public void init() throws HomekitException {
+        super.init();
         getServices().add(new DoorService(this));
     }
 
index 26a55a7dbd1c14acf6b8b53f56325405d84bef71..8fadfe9d7341b7670146f320c006247f34b7ae43 100644 (file)
@@ -18,6 +18,7 @@ import java.util.List;
 import java.util.concurrent.CompletableFuture;
 
 import org.openhab.io.homekit.internal.HomekitAccessoryUpdater;
+import org.openhab.io.homekit.internal.HomekitException;
 import org.openhab.io.homekit.internal.HomekitSettings;
 import org.openhab.io.homekit.internal.HomekitTaggedItem;
 
@@ -37,6 +38,11 @@ class HomekitFanImpl extends AbstractHomekitAccessoryImpl implements FanAccessor
             HomekitAccessoryUpdater updater, HomekitSettings settings) throws IncompleteAccessoryException {
         super(taggedItem, mandatoryCharacteristics, updater, settings);
         activeReader = createBooleanReader(ACTIVE_STATUS);
+    }
+
+    @Override
+    public void init() throws HomekitException {
+        super.init();
         this.getServices().add(new FanService(this));
     }
 
index a2ea89e7f43cea9f64bb2cdd003b2e93ea3e46e8..beeab7618012dcb8b2f4d64c49da7a52d3c3770c 100644 (file)
@@ -18,6 +18,7 @@ import java.util.List;
 import java.util.concurrent.CompletableFuture;
 
 import org.openhab.io.homekit.internal.HomekitAccessoryUpdater;
+import org.openhab.io.homekit.internal.HomekitException;
 import org.openhab.io.homekit.internal.HomekitSettings;
 import org.openhab.io.homekit.internal.HomekitTaggedItem;
 
@@ -37,6 +38,11 @@ class HomekitFaucetImpl extends AbstractHomekitAccessoryImpl implements FaucetAc
             HomekitAccessoryUpdater updater, HomekitSettings settings) throws IncompleteAccessoryException {
         super(taggedItem, mandatoryCharacteristics, updater, settings);
         activeReader = createBooleanReader(ACTIVE);
+    }
+
+    @Override
+    public void init() throws HomekitException {
+        super.init();
         this.getServices().add(new FaucetService(this));
     }
 
index 2b3c7a86591349e7fb8faa403766ff404735742d..5918da1dca9ec30207d5a3453fce8a4b96372504 100644 (file)
@@ -19,6 +19,7 @@ import java.util.Map;
 import java.util.concurrent.CompletableFuture;
 
 import org.openhab.io.homekit.internal.HomekitAccessoryUpdater;
+import org.openhab.io.homekit.internal.HomekitException;
 import org.openhab.io.homekit.internal.HomekitSettings;
 import org.openhab.io.homekit.internal.HomekitTaggedItem;
 
@@ -39,6 +40,11 @@ public class HomekitFilterMaintenanceImpl extends AbstractHomekitAccessoryImpl i
             HomekitAccessoryUpdater updater, HomekitSettings settings) throws IncompleteAccessoryException {
         super(taggedItem, mandatoryCharacteristics, updater, settings);
         mapping = createMapping(FILTER_CHANGE_INDICATION, FilterChangeIndicationEnum.class);
+    }
+
+    @Override
+    public void init() throws HomekitException {
+        super.init();
         getServices().add(new FilterMaintenanceService(this));
     }
 
index 19999565e6e744e2a49527e1a5cb5af71304f2f1..4284cbccd384068583d6ccb9eb0a3572cc0bd6ca 100644 (file)
@@ -21,6 +21,7 @@ import java.util.Map;
 import java.util.concurrent.CompletableFuture;
 
 import org.openhab.io.homekit.internal.HomekitAccessoryUpdater;
+import org.openhab.io.homekit.internal.HomekitException;
 import org.openhab.io.homekit.internal.HomekitSettings;
 import org.openhab.io.homekit.internal.HomekitTaggedItem;
 import org.slf4j.Logger;
@@ -49,7 +50,11 @@ public class HomekitGarageDoorOpenerImpl extends AbstractHomekitAccessoryImpl im
         obstructionReader = createBooleanReader(OBSTRUCTION_STATUS);
         currentDoorStateMapping = createMapping(CURRENT_DOOR_STATE, CurrentDoorStateEnum.class, true);
         targetDoorStateMapping = createMapping(TARGET_DOOR_STATE, TargetDoorStateEnum.class, true);
+    }
 
+    @Override
+    public void init() throws HomekitException {
+        super.init();
         getServices().add(new GarageDoorOpenerService(this));
     }
 
index 0547b25e109fbab074b53faff7d4c9b698106497..840e6ed0bd5bcc4f9fca70773be26e9a9b17e533 100644 (file)
@@ -28,6 +28,7 @@ import org.openhab.core.library.types.OnOffType;
 import org.openhab.core.library.types.OpenClosedType;
 import org.openhab.io.homekit.internal.HomekitAccessoryUpdater;
 import org.openhab.io.homekit.internal.HomekitCharacteristicType;
+import org.openhab.io.homekit.internal.HomekitException;
 import org.openhab.io.homekit.internal.HomekitSettings;
 import org.openhab.io.homekit.internal.HomekitTaggedItem;
 import org.slf4j.Logger;
@@ -66,6 +67,11 @@ public class HomekitHeaterCoolerImpl extends AbstractHomekitAccessoryImpl implem
                 customCurrentStateList);
         targetStateMapping = createMapping(TARGET_HEATER_COOLER_STATE, TargetHeaterCoolerStateEnum.class,
                 customTargetStateList);
+    }
+
+    @Override
+    public void init() throws HomekitException {
+        super.init();
         final HeaterCoolerService service = new HeaterCoolerService(this);
         service.addOptionalCharacteristic(new TemperatureDisplayUnitCharacteristic(this::getTemperatureDisplayUnit,
                 this::setTemperatureDisplayUnit, this::subscribeTemperatureDisplayUnit,
index 2d98158274c56e541a5a6c732e3346b0553d8c3c..abd24f9bd31ebe9e733a44d8d98ec73772604513 100644 (file)
@@ -20,6 +20,7 @@ import org.eclipse.jdt.annotation.Nullable;
 import org.openhab.core.library.types.DecimalType;
 import org.openhab.io.homekit.internal.HomekitAccessoryUpdater;
 import org.openhab.io.homekit.internal.HomekitCharacteristicType;
+import org.openhab.io.homekit.internal.HomekitException;
 import org.openhab.io.homekit.internal.HomekitSettings;
 import org.openhab.io.homekit.internal.HomekitTaggedItem;
 
@@ -37,6 +38,11 @@ public class HomekitHumiditySensorImpl extends AbstractHomekitAccessoryImpl impl
     public HomekitHumiditySensorImpl(HomekitTaggedItem taggedItem, List<HomekitTaggedItem> mandatoryCharacteristics,
             HomekitAccessoryUpdater updater, HomekitSettings settings) {
         super(taggedItem, mandatoryCharacteristics, updater, settings);
+    }
+
+    @Override
+    public void init() throws HomekitException {
+        super.init();
         getServices().add(new HumiditySensorService(this));
     }
 
index 5039aa57da17421987f821b3ab662756803c4217..e3895545c8212a043066309831cfaf457b61d3f2 100644 (file)
@@ -26,7 +26,6 @@ import io.github.hapjava.characteristics.impl.common.ConfiguredNameCharacteristi
 import io.github.hapjava.characteristics.impl.common.IdentifierCharacteristic;
 import io.github.hapjava.characteristics.impl.common.IsConfiguredCharacteristic;
 import io.github.hapjava.characteristics.impl.common.IsConfiguredEnum;
-import io.github.hapjava.characteristics.impl.common.NameCharacteristic;
 import io.github.hapjava.characteristics.impl.inputsource.CurrentVisibilityStateCharacteristic;
 import io.github.hapjava.characteristics.impl.inputsource.CurrentVisibilityStateEnum;
 import io.github.hapjava.characteristics.impl.inputsource.InputDeviceTypeCharacteristic;
@@ -85,7 +84,6 @@ public class HomekitInputSourceImpl extends AbstractHomekitAccessoryImpl {
         var service = new InputSourceService(configuredNameCharacteristic, inputSourceTypeCharacteristic,
                 isConfiguredCharacteristic, currentVisibilityStateCharacteristic);
 
-        getCharacteristic(NameCharacteristic.class).ifPresent(c -> service.addOptionalCharacteristic(c));
         service.addOptionalCharacteristic(identifierCharacteristic);
         getCharacteristic(InputDeviceTypeCharacteristic.class).ifPresent(c -> service.addOptionalCharacteristic(c));
         getCharacteristic(TargetVisibilityStateCharacteristic.class)
index e505e49883e010eac76bb59722978616863f6266..efc31cf0e4dbff10f80a38829899bea510fd1593 100644 (file)
@@ -20,6 +20,7 @@ import org.eclipse.jdt.annotation.NonNullByDefault;
 import org.openhab.core.library.types.OnOffType;
 import org.openhab.io.homekit.internal.HomekitAccessoryUpdater;
 import org.openhab.io.homekit.internal.HomekitCharacteristicType;
+import org.openhab.io.homekit.internal.HomekitException;
 import org.openhab.io.homekit.internal.HomekitSettings;
 import org.openhab.io.homekit.internal.HomekitTaggedItem;
 
@@ -58,7 +59,9 @@ public class HomekitIrrigationSystemImpl extends AbstractHomekitAccessoryImpl im
     }
 
     @Override
-    public void init() {
+    public void init() throws HomekitException {
+        super.init();
+
         String serviceLabelNamespaceConfig = getAccessoryConfiguration(SERVICE_LABEL, "ARABIC_NUMERALS");
         ServiceLabelNamespaceEnum serviceLabelEnum;
 
index 4312840d0ce7cfaa96681df818e4580afbc8d84e..577fa9b577f114e8a676b4960836207254da437b 100644 (file)
@@ -19,6 +19,7 @@ import java.util.Map;
 import java.util.concurrent.CompletableFuture;
 
 import org.openhab.io.homekit.internal.HomekitAccessoryUpdater;
+import org.openhab.io.homekit.internal.HomekitException;
 import org.openhab.io.homekit.internal.HomekitSettings;
 import org.openhab.io.homekit.internal.HomekitTaggedItem;
 
@@ -38,6 +39,11 @@ public class HomekitLeakSensorImpl extends AbstractHomekitAccessoryImpl implemen
             HomekitAccessoryUpdater updater, HomekitSettings settings) throws IncompleteAccessoryException {
         super(taggedItem, mandatoryCharacteristics, updater, settings);
         mapping = createMapping(LEAK_DETECTED_STATE, LeakDetectedStateEnum.class);
+    }
+
+    @Override
+    public void init() throws HomekitException {
+        super.init();
         getServices().add(new LeakSensorService(this));
     }
 
index d791d9cb8db9b6269299b111e301015981a8fb52..491733e78d39b85e52bf4cb7c6c035bdb49a50c1 100644 (file)
@@ -22,6 +22,7 @@ import org.eclipse.jdt.annotation.Nullable;
 import org.openhab.core.library.types.DecimalType;
 import org.openhab.io.homekit.internal.HomekitAccessoryUpdater;
 import org.openhab.io.homekit.internal.HomekitCharacteristicType;
+import org.openhab.io.homekit.internal.HomekitException;
 import org.openhab.io.homekit.internal.HomekitSettings;
 import org.openhab.io.homekit.internal.HomekitTaggedItem;
 
@@ -40,6 +41,11 @@ public class HomekitLightSensorImpl extends AbstractHomekitAccessoryImpl impleme
     public HomekitLightSensorImpl(HomekitTaggedItem taggedItem, List<HomekitTaggedItem> mandatoryCharacteristics,
             HomekitAccessoryUpdater updater, HomekitSettings settings) {
         super(taggedItem, mandatoryCharacteristics, updater, settings);
+    }
+
+    @Override
+    public void init() throws HomekitException {
+        super.init();
         getServices().add(new LightSensorService(this));
     }
 
index 827f3695090dd37c221c885b269110dcd1435a8b..b769c9c018a50a52693d50f754093f2712f97cf6 100644 (file)
@@ -21,6 +21,7 @@ import org.openhab.core.library.types.OnOffType;
 import org.openhab.io.homekit.internal.HomekitAccessoryUpdater;
 import org.openhab.io.homekit.internal.HomekitCharacteristicType;
 import org.openhab.io.homekit.internal.HomekitCommandType;
+import org.openhab.io.homekit.internal.HomekitException;
 import org.openhab.io.homekit.internal.HomekitSettings;
 import org.openhab.io.homekit.internal.HomekitTaggedItem;
 
@@ -38,7 +39,12 @@ class HomekitLightbulbImpl extends AbstractHomekitAccessoryImpl implements Light
     public HomekitLightbulbImpl(HomekitTaggedItem taggedItem, List<HomekitTaggedItem> mandatoryCharacteristics,
             HomekitAccessoryUpdater updater, HomekitSettings settings) {
         super(taggedItem, mandatoryCharacteristics, updater, settings);
-        this.getServices().add(new LightbulbService(this));
+    }
+
+    @Override
+    public void init() throws HomekitException {
+        super.init();
+        getServices().add(new LightbulbService(this));
     }
 
     @Override
index 96c804a26e6afe182678c7e3f80496e61ffcc4bf..80736a73c2182c5e7184c9d538dd3f5d8a040ace 100644 (file)
@@ -18,6 +18,7 @@ import java.util.concurrent.CompletableFuture;
 
 import org.openhab.io.homekit.internal.HomekitAccessoryUpdater;
 import org.openhab.io.homekit.internal.HomekitCharacteristicType;
+import org.openhab.io.homekit.internal.HomekitException;
 import org.openhab.io.homekit.internal.HomekitSettings;
 import org.openhab.io.homekit.internal.HomekitTaggedItem;
 
@@ -43,6 +44,11 @@ public class HomekitLockImpl extends AbstractHomekitAccessoryImpl implements Loc
 
         currentStateMapping = createMapping(HomekitCharacteristicType.LOCK_CURRENT_STATE, LockCurrentStateEnum.class);
         targetStateMapping = createMapping(HomekitCharacteristicType.LOCK_TARGET_STATE, LockTargetStateEnum.class);
+    }
+
+    @Override
+    public void init() throws HomekitException {
+        super.init();
         getServices().add(new LockMechanismService(this));
     }
 
index ba07a9cc5ef571f4d5106faceab706e60b3f1e93..582c5b9b5393a94aff96983a4ca3184b492da752 100644 (file)
@@ -27,6 +27,11 @@ import org.eclipse.jdt.annotation.NonNullByDefault;
 import org.openhab.io.homekit.internal.HomekitCharacteristicType;
 
 import io.github.hapjava.characteristics.Characteristic;
+import io.github.hapjava.characteristics.impl.accessoryinformation.FirmwareRevisionCharacteristic;
+import io.github.hapjava.characteristics.impl.accessoryinformation.HardwareRevisionCharacteristic;
+import io.github.hapjava.characteristics.impl.accessoryinformation.ManufacturerCharacteristic;
+import io.github.hapjava.characteristics.impl.accessoryinformation.ModelCharacteristic;
+import io.github.hapjava.characteristics.impl.accessoryinformation.SerialNumberCharacteristic;
 import io.github.hapjava.characteristics.impl.airquality.AirQualityCharacteristic;
 import io.github.hapjava.characteristics.impl.airquality.AirQualityEnum;
 import io.github.hapjava.characteristics.impl.common.ActiveCharacteristic;
@@ -83,11 +88,16 @@ public class HomekitMetadataCharacteristicFactory {
             put(CURRENT_HEATING_COOLING_STATE,
                     HomekitMetadataCharacteristicFactory::createCurrentHeatingCoolingStateCharacteristic);
             put(CURRENT_VISIBILITY, HomekitMetadataCharacteristicFactory::createCurrentVisibilityCharacteristic);
+            put(FIRMWARE_REVISION, HomekitMetadataCharacteristicFactory::createFirmwareRevisionCharacteristic);
+            put(HARDWARE_REVISION, HomekitMetadataCharacteristicFactory::createHardwareRevisionCharacteristic);
             put(IDENTIFIER, HomekitMetadataCharacteristicFactory::createIdentifierCharacteristic);
             put(INPUT_DEVICE_TYPE, HomekitMetadataCharacteristicFactory::createInputDeviceTypeCharacteristic);
             put(INPUT_SOURCE_TYPE, HomekitMetadataCharacteristicFactory::createInputSourceTypeCharacteristic);
+            put(MANUFACTURER, HomekitMetadataCharacteristicFactory::createManufacturerCharacteristic);
+            put(MODEL, HomekitMetadataCharacteristicFactory::createModelCharacteristic);
             put(NAME, HomekitMetadataCharacteristicFactory::createNameCharacteristic);
             put(PICTURE_MODE, HomekitMetadataCharacteristicFactory::createPictureModeCharacteristic);
+            put(SERIAL_NUMBER, HomekitMetadataCharacteristicFactory::createSerialNumberCharacteristic);
             put(SERVICE_INDEX, HomekitMetadataCharacteristicFactory::createServiceIndexCharacteristic);
             put(SLEEP_DISCOVERY_MODE, HomekitMetadataCharacteristicFactory::createSleepDiscoveryModeCharacteristic);
             put(TARGET_HEATER_COOLER_STATE,
@@ -221,6 +231,14 @@ public class HomekitMetadataCharacteristicFactory {
                 });
     }
 
+    private static Characteristic createFirmwareRevisionCharacteristic(Object value) {
+        return new FirmwareRevisionCharacteristic(getString(value));
+    }
+
+    private static Characteristic createHardwareRevisionCharacteristic(Object value) {
+        return new HardwareRevisionCharacteristic(getString(value));
+    }
+
     private static Characteristic createIdentifierCharacteristic(Object value) {
         return new IdentifierCharacteristic(getInteger(value));
     }
@@ -237,6 +255,14 @@ public class HomekitMetadataCharacteristicFactory {
         });
     }
 
+    private static Characteristic createManufacturerCharacteristic(Object value) {
+        return new ManufacturerCharacteristic(getString(value));
+    }
+
+    private static Characteristic createModelCharacteristic(Object value) {
+        return new ModelCharacteristic(getString(value));
+    }
+
     private static Characteristic createNameCharacteristic(Object value) {
         return new NameCharacteristic(getString(value));
     }
@@ -248,6 +274,10 @@ public class HomekitMetadataCharacteristicFactory {
         });
     }
 
+    private static Characteristic createSerialNumberCharacteristic(Object value) {
+        return new SerialNumberCharacteristic(getString(value));
+    }
+
     private static Characteristic createServiceIndexCharacteristic(Object value) {
         return new ServiceLabelIndexCharacteristic(getInteger(value));
     }
index 35f69ae286fce372cc4ab88b93badffd2d0d6b34..81c9ce05dab226443a0559608c8dd4c15f02d03c 100644 (file)
@@ -17,6 +17,7 @@ import java.util.concurrent.CompletableFuture;
 
 import org.openhab.io.homekit.internal.HomekitAccessoryUpdater;
 import org.openhab.io.homekit.internal.HomekitCharacteristicType;
+import org.openhab.io.homekit.internal.HomekitException;
 import org.openhab.io.homekit.internal.HomekitSettings;
 import org.openhab.io.homekit.internal.HomekitTaggedItem;
 
@@ -36,6 +37,11 @@ public class HomekitMicrophoneImpl extends AbstractHomekitAccessoryImpl implemen
             HomekitAccessoryUpdater updater, HomekitSettings settings) throws IncompleteAccessoryException {
         super(taggedItem, mandatoryCharacteristics, updater, settings);
         muteReader = createBooleanReader(HomekitCharacteristicType.MUTE);
+    }
+
+    @Override
+    public void init() throws HomekitException {
+        super.init();
         getServices().add(new MicrophoneService(this));
     }
 
index 099944b65b03037f956555094ecc3c7922d3289d..174bb81866ab5fa51d77b43d958f2a77b9b4d34f 100644 (file)
@@ -17,6 +17,7 @@ import java.util.concurrent.CompletableFuture;
 
 import org.openhab.io.homekit.internal.HomekitAccessoryUpdater;
 import org.openhab.io.homekit.internal.HomekitCharacteristicType;
+import org.openhab.io.homekit.internal.HomekitException;
 import org.openhab.io.homekit.internal.HomekitSettings;
 import org.openhab.io.homekit.internal.HomekitTaggedItem;
 
@@ -35,6 +36,11 @@ public class HomekitMotionSensorImpl extends AbstractHomekitAccessoryImpl implem
             HomekitAccessoryUpdater updater, HomekitSettings settings) throws IncompleteAccessoryException {
         super(taggedItem, mandatoryCharacteristics, updater, settings);
         motionSensedReader = createBooleanReader(HomekitCharacteristicType.MOTION_DETECTED_STATE);
+    }
+
+    @Override
+    public void init() throws HomekitException {
+        super.init();
         getServices().add(new MotionSensorService(this));
     }
 
index 0db4c347fec58592ad58e7583737584569e0abda..59d3aebbcbb7c01b93959ffbd8958ca3925a547a 100644 (file)
@@ -19,6 +19,7 @@ import java.util.Map;
 import java.util.concurrent.CompletableFuture;
 
 import org.openhab.io.homekit.internal.HomekitAccessoryUpdater;
+import org.openhab.io.homekit.internal.HomekitException;
 import org.openhab.io.homekit.internal.HomekitSettings;
 import org.openhab.io.homekit.internal.HomekitTaggedItem;
 
@@ -38,6 +39,11 @@ public class HomekitOccupancySensorImpl extends AbstractHomekitAccessoryImpl imp
             HomekitAccessoryUpdater updater, HomekitSettings settings) throws IncompleteAccessoryException {
         super(taggedItem, mandatoryCharacteristics, updater, settings);
         mapping = createMapping(OCCUPANCY_DETECTED_STATE, OccupancyDetectedEnum.class);
+    }
+
+    @Override
+    public void init() throws HomekitException {
+        super.init();
         getServices().add(new OccupancySensorService(this));
     }
 
index cf61a3f47fbc3e44a59829e11838665f3a7d8565..b7d32a3b01442d66086be83dcf72a6dfcf2b3793 100644 (file)
@@ -17,6 +17,7 @@ import java.util.concurrent.CompletableFuture;
 
 import org.openhab.io.homekit.internal.HomekitAccessoryUpdater;
 import org.openhab.io.homekit.internal.HomekitCharacteristicType;
+import org.openhab.io.homekit.internal.HomekitException;
 import org.openhab.io.homekit.internal.HomekitSettings;
 import org.openhab.io.homekit.internal.HomekitTaggedItem;
 
@@ -37,6 +38,11 @@ public class HomekitOutletImpl extends AbstractHomekitAccessoryImpl implements O
         super(taggedItem, mandatoryCharacteristics, updater, settings);
         inUseReader = createBooleanReader(HomekitCharacteristicType.INUSE_STATUS);
         onReader = createBooleanReader(HomekitCharacteristicType.ON_STATE);
+    }
+
+    @Override
+    public void init() throws HomekitException {
+        super.init();
         getServices().add(new OutletService(this));
     }
 
index 5c5ebd4cdc7c9e295fcc058160c0afd91fb9e904..7b21582cdea6bac8c869943a8f129c7c21a69b5f 100644 (file)
@@ -22,6 +22,7 @@ import java.util.concurrent.CompletableFuture;
 
 import org.openhab.io.homekit.internal.HomekitAccessoryUpdater;
 import org.openhab.io.homekit.internal.HomekitCharacteristicType;
+import org.openhab.io.homekit.internal.HomekitException;
 import org.openhab.io.homekit.internal.HomekitSettings;
 import org.openhab.io.homekit.internal.HomekitTaggedItem;
 
@@ -53,6 +54,11 @@ public class HomekitSecuritySystemImpl extends AbstractHomekitAccessoryImpl impl
                 customCurrentStateList);
         targetStateMapping = createMapping(SECURITY_SYSTEM_TARGET_STATE, TargetSecuritySystemStateEnum.class,
                 customTargetStateList);
+    }
+
+    @Override
+    public void init() throws HomekitException {
+        super.init();
         getServices().add(new SecuritySystemService(this));
     }
 
index 540c2a365441a940fe391ea18369ce1c10ecd0e0..f39a17b2c5937d288a35602001352116f59a585f 100644 (file)
@@ -19,6 +19,7 @@ import java.util.Map;
 import java.util.concurrent.CompletableFuture;
 
 import org.openhab.io.homekit.internal.HomekitAccessoryUpdater;
+import org.openhab.io.homekit.internal.HomekitException;
 import org.openhab.io.homekit.internal.HomekitSettings;
 import org.openhab.io.homekit.internal.HomekitTaggedItem;
 
@@ -43,6 +44,11 @@ public class HomekitSlatImpl extends AbstractHomekitAccessoryImpl implements Sla
         final String slatTypeConfig = getAccessoryConfiguration(CONFIG_TYPE, "horizontal");
         slatType = "horizontal".equalsIgnoreCase(slatTypeConfig) ? SlatTypeEnum.HORIZONTAL : SlatTypeEnum.VERTICAL;
         currentSlatStateMapping = createMapping(CURRENT_SLAT_STATE, CurrentSlatStateEnum.class);
+    }
+
+    @Override
+    public void init() throws HomekitException {
+        super.init();
         getServices().add(new SlatService(this));
     }
 
index e236863d971a9bf252af076a8892875ebf26780d..ae1704f099b05aa5d7a6dc4bdba6c704c754ae26 100644 (file)
@@ -20,6 +20,7 @@ import java.util.Map;
 import java.util.concurrent.CompletableFuture;
 
 import org.openhab.io.homekit.internal.HomekitAccessoryUpdater;
+import org.openhab.io.homekit.internal.HomekitException;
 import org.openhab.io.homekit.internal.HomekitSettings;
 import org.openhab.io.homekit.internal.HomekitTaggedItem;
 
@@ -42,6 +43,11 @@ public class HomekitSmartSpeakerImpl extends AbstractHomekitAccessoryImpl implem
         super(taggedItem, mandatoryCharacteristics, updater, settings);
         currentMediaState = createMapping(CURRENT_MEDIA_STATE, CurrentMediaStateEnum.class);
         targetMediaState = createMapping(TARGET_MEDIA_STATE, TargetMediaStateEnum.class);
+    }
+
+    @Override
+    public void init() throws HomekitException {
+        super.init();
         getServices().add(new SmartSpeakerService(this));
     }
 
index 2d124ec52f22b303f26ff05b5e8546ffe50eb13d..bf4a0661c0a49ae967b652c52c15b43efcc6a033 100644 (file)
@@ -19,6 +19,7 @@ import java.util.Map;
 import java.util.concurrent.CompletableFuture;
 
 import org.openhab.io.homekit.internal.HomekitAccessoryUpdater;
+import org.openhab.io.homekit.internal.HomekitException;
 import org.openhab.io.homekit.internal.HomekitSettings;
 import org.openhab.io.homekit.internal.HomekitTaggedItem;
 
@@ -38,6 +39,11 @@ public class HomekitSmokeSensorImpl extends AbstractHomekitAccessoryImpl impleme
             HomekitAccessoryUpdater updater, HomekitSettings settings) throws IncompleteAccessoryException {
         super(taggedItem, mandatoryCharacteristics, updater, settings);
         mapping = createMapping(SMOKE_DETECTED_STATE, SmokeDetectedStateEnum.class);
+    }
+
+    @Override
+    public void init() throws HomekitException {
+        super.init();
         this.getServices().add(new SmokeSensorService(this));
     }
 
index f0447f1479328f65fd1c0fb7bdfe7d17a13fd2e6..98732de9016d562be2ad1145c152576333e9df43 100644 (file)
@@ -17,6 +17,7 @@ import java.util.concurrent.CompletableFuture;
 
 import org.openhab.io.homekit.internal.HomekitAccessoryUpdater;
 import org.openhab.io.homekit.internal.HomekitCharacteristicType;
+import org.openhab.io.homekit.internal.HomekitException;
 import org.openhab.io.homekit.internal.HomekitSettings;
 import org.openhab.io.homekit.internal.HomekitTaggedItem;
 
@@ -36,6 +37,11 @@ public class HomekitSpeakerImpl extends AbstractHomekitAccessoryImpl implements
             HomekitAccessoryUpdater updater, HomekitSettings settings) throws IncompleteAccessoryException {
         super(taggedItem, mandatoryCharacteristics, updater, settings);
         muteReader = createBooleanReader(HomekitCharacteristicType.MUTE);
+    }
+
+    @Override
+    public void init() throws HomekitException {
+        super.init();
         getServices().add(new SpeakerService(this));
     }
 
index e5cd2df1b8485037de13f7c0605374ffce518f24..9e7ab5d157ff02218d62fc227088996dfd60744a 100644 (file)
@@ -18,6 +18,7 @@ import java.util.List;
 import java.util.concurrent.CompletableFuture;
 
 import org.openhab.io.homekit.internal.HomekitAccessoryUpdater;
+import org.openhab.io.homekit.internal.HomekitException;
 import org.openhab.io.homekit.internal.HomekitSettings;
 import org.openhab.io.homekit.internal.HomekitTaggedItem;
 
@@ -37,6 +38,11 @@ public class HomekitSwitchImpl extends AbstractHomekitAccessoryImpl implements S
             HomekitAccessoryUpdater updater, HomekitSettings settings) throws IncompleteAccessoryException {
         super(taggedItem, mandatoryCharacteristics, updater, settings);
         onReader = createBooleanReader(ON_STATE);
+    }
+
+    @Override
+    public void init() throws HomekitException {
+        super.init();
         getServices().add(new SwitchService(this));
     }
 
index ffa800b9bb44e85a96ecc9bb6f9b4b98c0b62673..10ce819421d82eee7725366293d3dfe26e9c1621 100644 (file)
@@ -24,7 +24,6 @@ import org.openhab.io.homekit.internal.HomekitTaggedItem;
 import io.github.hapjava.characteristics.impl.common.ActiveCharacteristic;
 import io.github.hapjava.characteristics.impl.common.ActiveIdentifierCharacteristic;
 import io.github.hapjava.characteristics.impl.common.ConfiguredNameCharacteristic;
-import io.github.hapjava.characteristics.impl.common.NameCharacteristic;
 import io.github.hapjava.characteristics.impl.lightbulb.BrightnessCharacteristic;
 import io.github.hapjava.characteristics.impl.television.ClosedCaptionsCharacteristic;
 import io.github.hapjava.characteristics.impl.television.CurrentMediaStateCharacteristic;
@@ -82,7 +81,6 @@ public class HomekitTelevisionImpl extends AbstractHomekitAccessoryImpl {
                 activeIdentifierCharacteristic, configuredNameCharacteristic, remoteKeyCharacteristic,
                 sleepDiscoveryModeCharacteristic);
 
-        getCharacteristic(NameCharacteristic.class).ifPresent(c -> service.addOptionalCharacteristic(c));
         getCharacteristic(BrightnessCharacteristic.class).ifPresent(c -> service.addOptionalCharacteristic(c));
         getCharacteristic(PowerModeCharacteristic.class).ifPresent(c -> service.addOptionalCharacteristic(c));
         getCharacteristic(ClosedCaptionsCharacteristic.class).ifPresent(c -> service.addOptionalCharacteristic(c));
index b538b7d27a773c29384f279e6674b4a631e134eb..bf024b57e2b57a7b77801ca6c8d838054b25452d 100644 (file)
@@ -19,6 +19,7 @@ import java.util.concurrent.CompletableFuture;
 import org.eclipse.jdt.annotation.Nullable;
 import org.openhab.io.homekit.internal.HomekitAccessoryUpdater;
 import org.openhab.io.homekit.internal.HomekitCharacteristicType;
+import org.openhab.io.homekit.internal.HomekitException;
 import org.openhab.io.homekit.internal.HomekitSettings;
 import org.openhab.io.homekit.internal.HomekitTaggedItem;
 
@@ -38,6 +39,11 @@ class HomekitTemperatureSensorImpl extends AbstractHomekitAccessoryImpl implemen
     public HomekitTemperatureSensorImpl(HomekitTaggedItem taggedItem, List<HomekitTaggedItem> mandatoryCharacteristics,
             HomekitAccessoryUpdater updater, HomekitSettings settings) {
         super(taggedItem, mandatoryCharacteristics, updater, settings);
+    }
+
+    @Override
+    public void init() throws HomekitException {
+        super.init();
         getServices().add(new TemperatureSensorService(this));
     }
 
index a3ce62e77c79f3fd30cfbc394aa67763f1d825ac..c851570316e3e082419a62aa916baeed6ff6a0c6 100644 (file)
@@ -26,6 +26,7 @@ import org.openhab.core.library.items.NumberItem;
 import org.openhab.core.library.types.DecimalType;
 import org.openhab.io.homekit.internal.HomekitAccessoryUpdater;
 import org.openhab.io.homekit.internal.HomekitCharacteristicType;
+import org.openhab.io.homekit.internal.HomekitException;
 import org.openhab.io.homekit.internal.HomekitSettings;
 import org.openhab.io.homekit.internal.HomekitTaggedItem;
 import org.slf4j.Logger;
@@ -67,6 +68,11 @@ class HomekitThermostatImpl extends AbstractHomekitAccessoryImpl implements Ther
                 CurrentHeatingCoolingStateEnum.class, customCurrentHeatingCoolingStateList);
         targetHeatingCoolingStateMapping = createMapping(TARGET_HEATING_COOLING_STATE,
                 TargetHeatingCoolingStateEnum.class, customTargetHeatingCoolingStateList);
+    }
+
+    @Override
+    public void init() throws HomekitException {
+        super.init();
         this.getServices().add(new ThermostatService(this));
     }
 
index f3a0141a188713d2d18e25a08d2b423fda37893e..479f9a12961cd5b77f0453243c51578972c86cc4 100644 (file)
@@ -33,6 +33,7 @@ import org.openhab.core.library.types.OnOffType;
 import org.openhab.core.types.RefreshType;
 import org.openhab.io.homekit.internal.HomekitAccessoryUpdater;
 import org.openhab.io.homekit.internal.HomekitCharacteristicType;
+import org.openhab.io.homekit.internal.HomekitException;
 import org.openhab.io.homekit.internal.HomekitSettings;
 import org.openhab.io.homekit.internal.HomekitTaggedItem;
 import org.slf4j.Logger;
@@ -79,11 +80,16 @@ public class HomekitValveImpl extends AbstractHomekitAccessoryImpl implements Va
         super(taggedItem, mandatoryCharacteristics, updater, settings);
         inUseReader = createBooleanReader(INUSE_STATUS);
         activeReader = createBooleanReader(ACTIVE_STATUS);
+        homekitTimer = getAccessoryConfigurationAsBoolean(CONFIG_TIMER, false);
+    }
+
+    @Override
+    public void init() throws HomekitException {
+        super.init();
         ValveService service = new ValveService(this);
         getServices().add(service);
-        homekitTimer = getAccessoryConfigurationAsBoolean(CONFIG_TIMER, false);
         if (homekitTimer) {
-            addRemainingDurationCharacteristic(taggedItem, updater, service);
+            addRemainingDurationCharacteristic(getRootAccessory(), getUpdater(), service);
         }
         String valveTypeConfig = getAccessoryConfiguration(CONFIG_VALVE_TYPE, "GENERIC");
         valveTypeConfig = getAccessoryConfiguration(CONFIG_VALVE_TYPE_DEPRECATED, valveTypeConfig);
index 622a6bb3d9df00fc59a749efb01a68cf85036b31..dfe1b6ac519900a274d1ad3798e0937c48fa1271 100644 (file)
@@ -17,6 +17,7 @@ import java.util.concurrent.CompletableFuture;
 
 import org.eclipse.jdt.annotation.NonNullByDefault;
 import org.openhab.io.homekit.internal.HomekitAccessoryUpdater;
+import org.openhab.io.homekit.internal.HomekitException;
 import org.openhab.io.homekit.internal.HomekitSettings;
 import org.openhab.io.homekit.internal.HomekitTaggedItem;
 
@@ -35,6 +36,11 @@ public class HomekitWindowCoveringImpl extends AbstractHomekitPositionAccessoryI
     public HomekitWindowCoveringImpl(HomekitTaggedItem taggedItem, List<HomekitTaggedItem> mandatoryCharacteristics,
             HomekitAccessoryUpdater updater, HomekitSettings settings) {
         super(taggedItem, mandatoryCharacteristics, updater, settings);
+    }
+
+    @Override
+    public void init() throws HomekitException {
+        super.init();
         getServices().add(new WindowCoveringService(this));
     }
 
index 42abdd7ea0674274234574e3c77334681df8f9a8..21bf0e44e7ebf8834b63d8c59ca32748bfee657b 100644 (file)
@@ -17,6 +17,7 @@ import java.util.concurrent.CompletableFuture;
 
 import org.eclipse.jdt.annotation.NonNullByDefault;
 import org.openhab.io.homekit.internal.HomekitAccessoryUpdater;
+import org.openhab.io.homekit.internal.HomekitException;
 import org.openhab.io.homekit.internal.HomekitSettings;
 import org.openhab.io.homekit.internal.HomekitTaggedItem;
 
@@ -35,6 +36,11 @@ public class HomekitWindowImpl extends AbstractHomekitPositionAccessoryImpl impl
     public HomekitWindowImpl(HomekitTaggedItem taggedItem, List<HomekitTaggedItem> mandatoryCharacteristics,
             HomekitAccessoryUpdater updater, HomekitSettings settings) {
         super(taggedItem, mandatoryCharacteristics, updater, settings);
+    }
+
+    @Override
+    public void init() throws HomekitException {
+        super.init();
         getServices().add(new WindowService(this));
     }