Removed deconz

This commit is contained in:
Ziver Koc 2021-09-09 17:53:07 +02:00
parent 28ff89d07f
commit f2dfe7a88f
11 changed files with 0 additions and 731 deletions

View file

@ -1,3 +0,0 @@
dependencies {
implementation project(':hal-core')
}

View file

@ -1,94 +0,0 @@
/*
* The MIT License (MIT)
*
* Copyright (c) 2020 Ziver Koc
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package se.hal.plugin.zigbee.deconz.zigbee;
import se.hal.HalContext;
import se.hal.intf.*;
import zutil.log.LogUtil;
import java.util.logging.Logger;
/**
* Class will handle Zigbee devices through the deConz REST API and with devices supporting.
*
* <p>
* Rest documentatiuon for deConz: https://dresden-elektronik.github.io/deconz-rest-doc/
*/
public class DeConzZigbeeController implements HalSensorController, HalEventController, HalAutostartController {
private static final Logger logger = LogUtil.getLogger();
public static final String CONFIG_ZIGBEE_REST_URL = "zigbee.rest_url";
public static final String CONFIG_ZIGBEE_REST_PORT = "zigbee.rest_port";
public static final String CONFIG_ZIGBEE_REST_USERNAME = "zigbee.rest_username";
public static final String CONFIG_ZIGBEE_REST_PASSWORD = "zigbee.rest_password";
public static final String CONFIG_ZIGBEE_COM_PORT = "zigbee.com_port";
@Override
public boolean isAvailable() {
return HalContext.containsProperty(CONFIG_ZIGBEE_REST_URL);
}
@Override
public void initialize() throws Exception {
// connect to deconz
// if username is set use that for basic auth
// else try without username or fail with log message that username should be setup
// Get API key
}
@Override
public void register(HalDeviceConfig deviceConfig) {
}
@Override
public void deregister(HalDeviceConfig deviceConfig) {
}
@Override
public void send(HalEventConfig eventConfig, HalEventData eventData) {
}
@Override
public void addListener(HalDeviceReportListener listener) {
}
@Override
public int size() {
return 0;
}
@Override
public void close() {
}
}

View file

@ -1,99 +0,0 @@
package se.hal.plugin.zigbee.deconz.zigbee.deconz.rest;
import zutil.net.ws.WSInterface.WSPath;
import zutil.net.ws.WSInterface.WSRequestType;
import zutil.parser.DataNode;
import static zutil.net.ws.WSInterface.RequestType.*;
/**
* The configuration endpoint allows to retreive and modify the current configuration of the gateway.
*
* @link https://dresden-elektronik.github.io/deconz-rest-doc/configuration/
*/
public interface DeConzRestConfig {
/**
* Creates a new API key which provides authorized access to the REST API.
*
* @param deviceType Name of the client application. (required)
* @param username Will be used as username. If not specified a random key will be generated. (optional)
*/
@WSRequestType(POST)
@WSPath("/api")
DataNode getAPIKey(String deviceType, String username);
/**
* Deletes an API key so it can no longer be used.
*/
@WSRequestType(DELETE)
@WSPath("/api/{{requestApiKey}}/config/whitelist/{{apikey2}}")
DataNode deleteAPIKey(String requestApiKey, String deleteApiKey);
/**
* Returns the current gateway configuration.
*/
@WSRequestType(GET)
@WSPath("/api/{{requestApiKey}}/config")
void getConfiguration(String requestApiKey);
/**
* Modify configuration parameters.
*/
//@WSRequestType(HTTP_PUT)
//@WSPath("/api/{{requestApiKey}}/config")
//void setConfiguration(String requestApiKey);
/**
* Returns the full state of the gateway including all its lights, groups, scenes and schedules.
*/
@WSRequestType(GET)
@WSPath("/api/{{requestApiKey}}")
void getFullState(String requestApiKey);
/**
* Returns the newest software version available. Starts the update if available (only on raspberry pi).
*/
@WSRequestType(POST)
@WSPath("/api/{{requestApiKey}}/config/update")
void updateSoftware(String requestApiKey);
/**
* Starts the update firmware process if newer firmware is available.
*/
@WSRequestType(POST)
@WSPath("/api/{{requestApiKey}}/config/updatefirmware")
void updateFirmware(String requestApiKey);
/**
* Reset the gateway network settings to factory new and/or delete the deCONZ database (config, lights, scenes, groups, schedules, devices, rules).
*
* @param resetGW Set the network settings of the gateway to factory new. (optional)
* @param deleteDB Delete the Database. (optional)
*/
@WSRequestType(POST)
@WSPath("/api/{{requestApiKey}}/config/reset")
void resetGateway(String requestApiKey, boolean resetGW, boolean deleteDB);
/**
* Change the Password of the Gateway. The parameter must be a Base64 encoded combination of "<username>:<password>".
*
* @param username The user name (currently only "delight" is supported). (required)
* @param oldHash String The Base64 encoded combination of "username:old password". (required)
* @param newHash String The Base64 encoded combination of "username:new password". (required)
*/
@WSRequestType(PUT)
@WSPath("/api/{{requestApiKey}}/config/password")
void setPassword(String requestApiKey, String username, String oldHash, String newHash);
/**
* Resets the username and password to default ("delight","delight"). Only possible within 10 minutes after gateway start.
*/
@WSRequestType(DELETE)
@WSPath("/api/{{requestApiKey}}/config/password")
void resetPassword(String requestApiKey);
}

View file

@ -1,79 +0,0 @@
package se.hal.plugin.zigbee.deconz.zigbee.deconz.rest;
import zutil.net.ws.WSInterface.WSPath;
import zutil.net.ws.WSInterface.WSRequestType;
import java.util.List;
import static zutil.net.ws.WSInterface.RequestType.*;
/**
* Groups are useful to control many lights at once and provide the base to use scenes.
*
* @link https://dresden-elektronik.github.io/deconz-rest-doc/groups/
*/
public interface DeConzRestGroups {
/**
* Creates a new empty group.
*
* @param name The name of the new group. (required)
*/
@WSRequestType(POST)
@WSPath("/api/{{requestApiKey}}/groups")
void createGroup(String requestApiKey, String name);
/**
* Returns a list of all groups.
*/
@WSRequestType(GET)
@WSPath("/api/{{requestApiKey}}/groups")
void getGroups(String requestApiKey);
/**
* Returns the full state of a group.
*/
@WSRequestType(GET)
@WSPath("/api/{{requestApiKey}}/groups/{{groupId}}")
void getGroup(String requestApiKey, int groupId);
/**
* Sets attributes of a group which are not related to its state.
*
* @param name The name of the group optional
* @param lights IDs of the lights which are members of the group. optional
* @param hidden Indicates the hidden status of the group. Has no effect at the gateway but apps can uses this to hide groups. optional
* @param lightSequence Specify a sorted list of light ids that can be used in apps. optional
* @param multiDeviceIds Append the subsequential light ids of multidevices like the FLS-PP if the app should handle that light differently.
*/
@WSRequestType(PUT)
@WSPath("/api/{{requestApiKey}}/groups/{{groupId}}")
void setGroup(String requestApiKey, int groupId, String name, List lights, boolean hidden, List lightSequence, List multiDeviceIds);
/**
* Sets attributes of a group which are not related to its state.
*
* @param on Set to true to turn the lights on, false to turn them off. optional
* @param toggle Set to true toggles the lights of that group from on to off or vice versa, false has no effect. **Notice:** This setting supersedes the `on` parameter! optional
* @param bri Set the brightness of the group. Depending on the lights 0 might not mean visible "off" but minimum brightness. If the lights are off and the value is greater 0 a on=true shall also be provided. optional
* @param hue Set the color hue of the group. The hue parameter in the HSV color model is between 0°-360° and is mapped to 0..65535 to get 16-bit resolution. optional
* @param sat Set the color saturation of the group. There 0 means no color at all and 255 is the highest saturation of the color. optional
* @param ct Set the Mired color temperature of the group. (2000K - 6500K) optional
* @param xy Set the CIE xy color space coordinates as array [x, y] of real values (0..1). optional
* @param alert Trigger a temporary alert effect: none (lights are not performing an alert), select (lights are blinking a short time), lselect (lights are blinking a longer time). (optional)
* @param effect Trigger an effect of the group: none (no effect), colorloop (the lights of the group will cycle continously through all colors with the speed specified by colorloopspeed). (optional)
* @param colorLoopSpeed Specifies the speed of a colorloop. 1 = very fast, 255 = very slow (default: 15). This parameter only has an effect when it is called together with effect colorloop. (optional)
* @param transitionTime Transition time in 1/10 seconds between two states. (optional)
*/
@WSRequestType(PUT)
@WSPath("/api/{{requestApiKey}}/groups/{{groupId}}/action")
void setGroupState(String requestApiKey, int groupId, boolean on, boolean toggle, int bri, int hue, int sat, int ct, List xy, String alert, String effect, int colorLoopSpeed, int transitionTime);
/**
* Deletes a group.
*/
@WSRequestType(DELETE)
@WSPath("/api/{{requestApiKey}}/groups/{{groupId}}")
void deleteGroup(String requestApiKey, int groupId);
}

View file

@ -1,81 +0,0 @@
package se.hal.plugin.zigbee.deconz.zigbee.deconz.rest;
import zutil.net.ws.WSInterface.WSPath;
import zutil.net.ws.WSInterface.WSRequestType;
import java.util.List;
import static zutil.net.ws.WSInterface.RequestType.*;
/**
* Monitor and control single lights.
*
* @link https://dresden-elektronik.github.io/deconz-rest-doc/lights/
*/
public interface DeConzRestLights {
/**
* Returns a list of all lights.
*/
@WSRequestType(GET)
@WSPath("/api/{{requestApiKey}}/lights")
void getLights(String requestApiKey);
/**
* Returns the full state of a light.
*/
@WSRequestType(GET)
@WSPath("/api/{{requestApiKey}}/lights/{{lightId}")
void getLight(String requestApiKey, int lightId);
/**
* Returns the full state of a light.
*
* @param name Set the name of the light. (required)
*/
@WSRequestType(PUT)
@WSPath("/api/{{requestApiKey}}/lights/{{lightId}")
void setLight(String requestApiKey, int lightId, String name);
/**
* Sets the state of a light.
*
* @param on Set to true to turn the lights on, false to turn them off. optional
* @param toggle Set to true toggles the lights of that group from on to off or vice versa, false has no effect. **Notice:** This setting supersedes the `on` parameter! optional
* @param bri Set the brightness of the group. Depending on the lights 0 might not mean visible "off" but minimum brightness. If the lights are off and the value is greater 0 a on=true shall also be provided. optional
* @param hue Set the color hue of the group. The hue parameter in the HSV color model is between 0°-360° and is mapped to 0..65535 to get 16-bit resolution. optional
* @param sat Set the color saturation of the group. There 0 means no color at all and 255 is the highest saturation of the color. optional
* @param ct Set the Mired color temperature of the group. (2000K - 6500K) optional
* @param xy Set the CIE xy color space coordinates as array [x, y] of real values (0..1). optional
* @param alert Trigger a temporary alert effect: none (lights are not performing an alert), select (lights are blinking a short time), lselect (lights are blinking a longer time). (optional)
* @param effect Trigger an effect of the group: none (no effect), colorloop (the lights of the group will cycle continously through all colors with the speed specified by colorloopspeed). (optional)
* @param colorLoopSpeed Specifies the speed of a colorloop. 1 = very fast, 255 = very slow (default: 15). This parameter only has an effect when it is called together with effect colorloop. (optional)
* @param transitionTime Transition time in 1/10 seconds between two states. (optional)
*/
@WSRequestType(GET)
@WSPath("/api/{{requestApiKey}}/lights/{{lightId}/state")
void setLightState(String requestApiKey, int lightId, boolean on, boolean toggle, int bri, int hue, int sat, int ct, List xy, String alert, String effect, int colorLoopSpeed, int transitionTime);
/**
* Removes the light from the gateway. It will not be shown in any rest api call. Also deletes all groups and scenes on the light device.
*
* @param reset If true sends a network leave command to the light device (may not supported by each manufacturer). (optional)
*/
@WSRequestType(PUT)
@WSPath("/api/{{requestApiKey}}/lights/{{lightId}")
void deleteLight(String requestApiKey, int lightId, boolean reset);
/**
* Remove the light from all groups it is a member of.
*/
@WSRequestType(DELETE)
@WSPath("/api/{{requestApiKey}}/lights/{{lightId}/groups")
void deleteGroups(String requestApiKey, int lightId);
/**
* Remove the light from all scenes it is a member of.
*/
@WSRequestType(DELETE)
@WSPath("/api/{{requestApiKey}}/lights/{{lightId}/scenes")
void deleteScenes(String requestApiKey, int lightId);
}

View file

@ -1,72 +0,0 @@
package se.hal.plugin.zigbee.deconz.zigbee.deconz.rest;
import zutil.net.ws.WSInterface.WSPath;
import zutil.net.ws.WSInterface.WSRequestType;
import static zutil.net.ws.WSInterface.RequestType.DELETE;
import static zutil.net.ws.WSInterface.RequestType.GET;
/**
* Rules provide the ability to trigger actions of lights or groups when a specific sensor condition is met.
*
* @link https://dresden-elektronik.github.io/deconz-rest-doc/rules/
*/
public interface DeConzRestRules {
/**
* Creates a new rule.
* <p>Note: To create ZigBee bindings between a sensor and a light or group use the BIND method. The rules condition specifies which ZigBee cluster will be used.
*
* @param name The name of the rule. required
* @param periodic Specifies if the rule should trigger periodically. 0 = trigger on event; >0 = time in ms the rule will be triggered periodically. Default is 0. optional
* @param status String ("enabled"|"disabled")
* @param actions An array of actions that will happen when the rule triggers. required
* action.address path to a light, group or scene resource required
* action.body Parameters that will be send to the resource formated as JSON. required
* action.method String Can be PUT, POST, DELETE (currently only used for green power devices) or BIND which will create a ZigBee binding between a sensor and a light or group. required
* @param conditions Array(condition) (1..8) The conditions that must be met to trigger a rule. required
* condition.address String path to a sensor resource and the related state required
* condition.operator String eq, gt, lt, dx (equals, greater than, lower than, on change). required
* condition.value String The value the operator is compared with. Will be casted automatically to the corresponding data type. required
*/
//@WSRequestType(HTTP_POST)
//@WSPath("/api/{{requestApiKey}}/rules")
//void createRule(String requestApiKey, String name, int periodic, String status, List actions, List conditions);
/**
* Returns a list of all rules. If there are no rules in the system then an empty object {} will be returned.
*/
@WSRequestType(GET)
@WSPath("/api/{{requestApiKey}}/rules")
void getRules(String requestApiKey);
/**
* Returns the rule with the specified id.
*/
@WSRequestType(GET)
@WSPath("/api/{{requestApiKey}}/rules/{{ruleId}}")
void getRule(String requestApiKey, int ruleId);
/**
* Update a rule with the specified parameters.
*
* @param name The name of the rule. required
* @param periodic Specifies if the rule should trigger periodically. 0 = trigger on event; >0 = time in ms the rule will be triggered periodically. Default is 0. optional
* @param status String ("enabled"|"disabled")
* @param actions An array of actions that will happen when the rule triggers. required
* action.address path to a light, group or scene resource required
* action.body Parameters that will be send to the resource formated as JSON. required
* action.method String Can be PUT, POST, DELETE (currently only used for green power devices) or BIND which will create a ZigBee binding between a sensor and a light or group. required
* @param conditions Array(condition) (1..8) The conditions that must be met to trigger a rule. required
* condition.address String path to a sensor resource and the related state required
* condition.operator String eq, gt, lt, dx (equals, greater than, lower than, on change). required
* condition.value String The value the operator is compared with. Will be casted automatically to the corresponding data type. required
*/
//@WSRequestType(HTTP_PUT)
//@WSPath("/api/{{requestApiKey}}/rules/{{ruleId}}")
//void setRule(String requestApiKey, int ruleId, String name, int periodic, String status, List actions, List conditions);
@WSRequestType(DELETE)
@WSPath("/api/{{requestApiKey}}/rules/{{ruleId}}")
void deleteRule(String requestApiKey, int ruleId);
}

View file

@ -1,81 +0,0 @@
package se.hal.plugin.zigbee.deconz.zigbee.deconz.rest;
import zutil.net.ws.WSInterface.WSPath;
import zutil.net.ws.WSInterface.WSRequestType;
import static zutil.net.ws.WSInterface.RequestType.*;
/**
* Scenes provide an easy and performant way to recall often used states to a group.
*
* @link https://dresden-elektronik.github.io/deconz-rest-doc/scenes/
*/
public interface DeConzRestScenes {
/**
* Creates a new scene for a group. The actual state of each light will become the lights scene state.
*
* @param name The name of the new scene. (required)
*/
@WSRequestType(POST)
@WSPath("/api/{{requestApiKey}}/groups/{{group_id}}/scenes")
void createScene(String requestApiKey, int groupId, String name);
/**
* Returns a list of all scenes of a group.
*/
@WSRequestType(GET)
@WSPath("/api/{{requestApiKey}}/groups/{{group_id}}/scenes")
void getScenes(String requestApiKey, int groupId);
/**
* Returns all attributes of a scene.
*/
@WSRequestType(GET)
@WSPath("/api/{{requestApiKey}}/groups/{{group_id}}/scenes/{{sceneId}}")
void getScene(String requestApiKey, int groupId, int sceneId);
/**
* Sets attributes of a scene.
*
* @param name Name of the scene. (optional)
*/
@WSRequestType(PUT)
@WSPath("/api/{{requestApiKey}}/groups/{{group_id}}/scenes/{{sceneId}}")
void getScene(String requestApiKey, int groupId, int sceneId, String name);
/**
* Stores the current group state in the scene. The actual state of each light in the group will become the lights scene state.
*/
@WSRequestType(PUT)
@WSPath("/api/{{requestApiKey}}/groups/{{group_id}}/scenes/{{sceneId}}/store")
String storeScene(String requestApiKey, int groupId, int sceneId);
/**
* Recalls a scene. The actual state of each light in the group will become the lights scene state stored in each light.
* Note: Lights which are not reachable (turned off) wont be affected!
*/
@WSRequestType(PUT)
@WSPath("/api/{{requestApiKey}}/groups/{{group_id}}/scenes/{{sceneId}}/recall")
void recallScene(String requestApiKey, int groupId, int sceneId);
/**
* Recalls a scene. The actual state of each light in the group will become the lights scene state stored in each light.
* Note: Lights which are not reachable (turned off) wont be affected!
*
* @param on Set to true to turn the lights on, false to turn them off. optional
* @param bri Set the brightness of the group. Depending on the lights 0 might not mean visible "off" but minimum brightness. If the lights are off and the value is greater 0 a on=true shall also be provided. optional
* @param xy Set the CIE xy color space coordinates as array [x, y] of real values (0..1). optional
* @param transitionTime Transition time in 1/10 seconds between two states. (optional)
*/
@WSRequestType(PUT)
@WSPath("/api/{{requestApiKey}}/groups/{{group_id}}/scenes/{{sceneId}}/state/lights/{{lightId}}/state")
void setSceneState(String requestApiKey, int groupId, int sceneId, int lightId, int on, int bri, int xy, int transitionTime);
/**
* Deletes a scene.
*/
@WSRequestType(DELETE)
@WSPath("/api/{{requestApiKey}}/groups/{{group_id}}/scenes/{{sceneId}}")
void deleteScene(String requestApiKey, int groupId, int sceneId);
}

View file

@ -1,71 +0,0 @@
package se.hal.plugin.zigbee.deconz.zigbee.deconz.rest;
import zutil.net.ws.WSInterface.WSPath;
import zutil.net.ws.WSInterface.WSRequestType;
import java.util.List;
import static zutil.net.ws.WSInterface.RequestType.*;
/**
* Schedules provide the ability to trigger timed commands to groups or lights.
*
* @link https://dresden-elektronik.github.io/deconz-rest-doc/schedules/
*/
public interface DeConzRestSchedules {
/**
* Creates a new schedule.
*
* @param name The name of the new schedule. If the name already exists a number will be appended. (optional)
* @param description The description of the schedule. (optional)
* @param command The command to execute when the schedule triggers. (required)
* command.address The address of a light or group resource. (required)
* command.method must be "PUT", (required)
* command.body The state that the light or group will activate when the schedule triggers, (required)
* @param status ("enabled"|"disabled") Whether the schedule is enabled or disabled. Default is enabled. (optional)
* @param autoDelete If true the schedule will be deleted after triggered. Else it will be disabled. Default is true. (optional)
* @param time Time when the schedule shall trigger in UTC ISO 8601:2004 format. (required)
*/
//@WSRequestType(HTTP_POST)
//@WSPath("/api/{{requestApiKey}}/schedules")
//int createSchedule(String requestApiKey, String name, String description, List command, String status, boolean autoDelete, String time);
/**
* Returns a list of all schedules.
*/
@WSRequestType(GET)
@WSPath("/api/{{requestApiKey}}/schedules")
List getSchedules(String requestApiKey);
/**
* Returns all attributes of a schedule.
*/
@WSRequestType(GET)
@WSPath("/api/{{requestApiKey}}/schedules/{{scheduleId}}")
List getSchedule(String requestApiKey, int scheduleId);
/**
* Creates a new schedule.
*
* @param name The name of the new schedule. If the name already exists a number will be appended. (optional)
* @param description The description of the schedule. (optional)
* @param command The command to execute when the schedule triggers. (required)
* command.address The address of a light or group resource. (required)
* command.method must be "PUT", (required)
* command.body The state that the light or group will activate when the schedule triggers, (required)
* @param status ("enabled"|"disabled") Whether the schedule is enabled or disabled. Default is enabled. (optional)
* @param autoDelete If true the schedule will be deleted after triggered. Else it will be disabled. Default is true. (optional)
* @param time Time when the schedule shall trigger in UTC ISO 8601:2004 format. (required)
*/
@WSRequestType(PUT)
@WSPath("/api/{{requestApiKey}}/schedules/{{scheduleId}}")
void setSchedule(String requestApiKey, int scheduleId, String name, String description, List command, String status, boolean autoDelete, String time);
/**
* Returns all attributes of a schedule.
*/
@WSRequestType(DELETE)
@WSPath("/api/{{requestApiKey}}/schedules/{{scheduleId}}")
void deleteSchedule(String requestApiKey, int scheduleId);
}

View file

@ -1,97 +0,0 @@
package se.hal.plugin.zigbee.deconz.zigbee.deconz.rest;
import zutil.net.ws.WSInterface.WSPath;
import zutil.net.ws.WSInterface.WSRequestType;
import java.util.List;
import java.util.Map;
import static zutil.net.ws.WSInterface.RequestType.*;
/**
* Sensors can be used to measure environment parameters like brightness or activation of a switch. With a corresponding rule they can control lights and groups.
*
* @link https://dresden-elektronik.github.io/deconz-rest-doc/sensors/
*/
public interface DeConzRestSensors {
/**
* Creates a new sensor.
*
* @param name The name of the sensor. required
* @param modelid The model identifier of the sensor. required
* @param swversion The software version of the sensor. required
* @param type The type of the sensor (see: allowed sensor types and its states). required
* @param uniqueid The unique id of the sensor. Should be the MAC address of the device. required
* @param manufacturername The manufacturer name of the sensor. required
* @param state The state of the sensor (see: supported sensor types and its states). optional
* @param config The config of the sensor. (optional)
* on - Bool - default: true
* reachable - Bool - default: true
* battery - Number (0..100)
*/
@WSRequestType(POST)
@WSPath("/api/{{requestApiKey}}/sensors")
void createSensor(String requestApiKey, int groupId, String name, String modelid, String swversion, String type, String uniqueid, String manufacturername, Map state, Map config);
/**
* Returns a list of all Sensors. If there are no sensors in the system then an empty object {} will be returned.
*/
@WSRequestType(GET)
@WSPath("/api/{{requestApiKey}}/sensors")
List getSensor(String requestApiKey);
/**
* Returns a list of all Sensors. If there are no sensors in the system then an empty object {} will be returned.
*/
@WSRequestType(GET)
@WSPath("/api/{{requestApiKey}}/sensors/{{sensorId}}")
void getSensor(String requestApiKey, int sensorId);
/**
* Update a sensor with the specified parameters.
*
* @param name The name of the sensor. (optional)
* @param mode Only available for dresden elektronik Lighting Switch. Set the mode of the switch. (optional)
* 1 = Scenes mode
* 2 = Two groups mode
* 3 = Color temperature mode
*/
@WSRequestType(PUT)
@WSPath("/api/{{requestApiKey}}/sensors/{{sensorId}}")
void setSensor(String requestApiKey, int sensorId, String name, int mode);
/**
* Update a sensor with the specified parameters.
*
* @param on The on/off status of the sensor. (optional)
* @param reachable The reachable status of the sensor. (optional)
* @param battery The current battery state in percent, only for battery powered devices. (optional)
*/
@WSRequestType(PUT)
@WSPath("/api/{{requestApiKey}}/sensors/{{sensorId}}/config")
void setSensorConfig(String requestApiKey, int sensorId, boolean on, boolean reachable, int battery);
/**
* Update a sensor state with the specified parameters.
*
* @param flag Sensor type | Allowed state | type
* CLIPSwitch buttonevent Number
* CLIPOpenClose open Bool
* CLIPPresence presence Bool
* CLIPTemperature temperature Number
* CLIPGenericFlag flag Bool
* CLIPGenericStatus status Number
* CLIPHumidity humidity Number
*/
@WSRequestType(PUT)
@WSPath("/api/{{requestApiKey}}/sensors/{{sensorId}}/state")
void setSensorState(String requestApiKey, String flag);
/**
* Delete a sensor.
*/
@WSRequestType(DELETE)
@WSPath("/api/{{requestApiKey}}/sensors/{{sensorId}}/state")
void deleteSensor(String requestApiKey, int sensorId);
}

View file

@ -1,46 +0,0 @@
package se.hal.plugin.zigbee.deconz.zigbee.deconz.rest;
import zutil.net.ws.WSInterface.WSPath;
import zutil.net.ws.WSInterface.WSRequestType;
import static zutil.net.ws.WSInterface.RequestType.GET;
import static zutil.net.ws.WSInterface.RequestType.POST;
/**
* The touchlink endpoint allows to communicate with near by located devices.
*
* @link https://dresden-elektronik.github.io/deconz-rest-doc/touchlink/
*/
public interface DeConzRestTouchlink {
/**
* Starts scanning on all channels for devices which are located close to the gateway. The whole scan process will take about 10 seconds.
* <p>Note: While scanning is in progress further API requests which require network access arent allowed.
*/
@WSRequestType(POST)
@WSPath("/api/{{requestApiKey}}/touchlink/scan")
void startDeviceScan(String requestApiKey);
/**
* Returns the results of a touchlink scan.
*/
@WSRequestType(GET)
@WSPath("/api/{{requestApiKey}}/touchlink/scan")
void getScanResult(String requestApiKey);
/**
* Puts a device into identify mode for example a light will blink a few times.
* <p>Note: touchlinkId must be one of the indentifiers which are returned in the scan result.
*/
@WSRequestType(POST)
@WSPath("/api/{{requestApiKey}}/touchlink/{{touchlinkId}}/identify")
void identifyDevice(String requestApiKey, int touchlinkId);
/**
* Send a reset to factory new request to a device.
* <p>Note: touchlinkId must be one of the indentifiers which are returned in the scan result.
*/
@WSRequestType(POST)
@WSPath("/api/{{requestApiKey}}/touchlink/{{touchlinkId}}/reset")
void resetDevice(String requestApiKey, int touchlinkId);
}

View file

@ -1,8 +0,0 @@
{
"version": 0.1,
"name": "Hal-Zigbee-DeConz",
"description": "A Zigbee plugin interfacing with a DeConz service.",
"interfaces": [
{"se.hal.intf.HalAutostartController": "se.hal.plugin.zigbee.deconz.zigbee.HalDeconzZigbeeController"}
]
}