The HDM Module allows you to implement a custom mechanism for configuring the properties of devices and zones in your system.
Overview
Sometimes you may need to configure the devices and zones in your system by giving initial values to their configuration properties, and/or adding some new properties. The HomeDeviceConfigAdmin and HomeZoneConfigAdmin allow you to implement custom logic that achieves that task.
Devices/zones that are configured using this mechanism are configured before they are made available to HDM and to all applications that use it.
Configuring Devices
You can implement mechanism for configuring devices by implementing the HomeDeviceConfigAdmin interface along with its related interfaces and registering it as an OSGi service.
Implement HomeDeviceConfigAdmin
The Home Device Admin communicates with your service by using the following methods of the HomeDeviceConfigAdmin interface:
Additionally the Home Device Admin uses the setConfigurationHandler method to provide the service with a object that handles new and updated configurations - HomeDeviceConfigHandler.
Use HomeDeviceConfigHandler
Use methods of the HomeDeviceConfigHandler interface to notify the Home Device Manager when new configurations are available.
Register the HomeDeviceConfigAdmin Implementation as an OSGi Service
Register the HomeDeviceConfigAdmin instance as a service in the OSGi framework. The Home Device Manager will automatically discover the presence of the adapter and will attach it to its system.
Configuring Zones
Zones can be configured in the same way as the devices with the HomeZoneConfigAdmin interface corresponding to HomeDeviceConfigAdmin and HomeZoneConfigHandler to HomeDeviceConfigHandler.
Current Implementations
There are default implementations of the HomeDeviceConfigAdmin and HomeZoneConfigAdmin interfaces provided with the HDM Config Tree Bundle bundle.