Refactoring of of inheritance structure, ControllerManagers will now also be able to be provided through plugins

This commit is contained in:
Ziver Koc 2021-03-16 22:24:43 +01:00
parent 28bc108921
commit c0188cd5cc
73 changed files with 1083 additions and 991 deletions

View file

@ -36,7 +36,7 @@ import java.util.logging.Logger;
* <p>
* Rest documentatiuon for deConz: https://dresden-elektronik.github.io/deconz-rest-doc/
*/
public class HalDeConzZigbeeController implements HalSensorController, HalEventController, HalAutoScannableController {
public class DeConzZigbeeController implements HalSensorController, HalEventController, HalAutoScannableController {
private static final Logger logger = LogUtil.getLogger();
public static final String CONFIG_ZIGBEE_REST_URL = "zigbee.rest_url";
@ -62,17 +62,12 @@ public class HalDeConzZigbeeController implements HalSensorController, HalEventC
@Override
public void setListener(HalEventReportListener listener) {
public void register(HalDeviceConfig deviceConfig) {
}
@Override
public void register(HalEventConfig eventConfig) {
}
@Override
public void deregister(HalEventConfig eventConfig) {
public void deregister(HalDeviceConfig deviceConfig) {
}
@ -81,19 +76,8 @@ public class HalDeConzZigbeeController implements HalSensorController, HalEventC
}
@Override
public void register(HalSensorConfig sensorConfig) {
}
@Override
public void deregister(HalSensorConfig sensorConfig) {
}
@Override
public void setListener(HalSensorReportListener listener) {
public void setListener(HalDeviceReportListener listener) {
}

View file

@ -19,14 +19,14 @@ public interface DeConzRestConfig {
* @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(HTTP_POST)
@WSRequestType(POST)
@WSPath("/api")
DataNode getAPIKey(String deviceType, String username);
/**
* Deletes an API key so it can no longer be used.
*/
@WSRequestType(HTTP_DELETE)
@WSRequestType(DELETE)
@WSPath("/api/{{requestApiKey}}/config/whitelist/{{apikey2}}")
DataNode deleteAPIKey(String requestApiKey, String deleteApiKey);
@ -34,7 +34,7 @@ public interface DeConzRestConfig {
/**
* Returns the current gateway configuration.
*/
@WSRequestType(HTTP_GET)
@WSRequestType(GET)
@WSPath("/api/{{requestApiKey}}/config")
void getConfiguration(String requestApiKey);
@ -48,7 +48,7 @@ public interface DeConzRestConfig {
/**
* Returns the full state of the gateway including all its lights, groups, scenes and schedules.
*/
@WSRequestType(HTTP_GET)
@WSRequestType(GET)
@WSPath("/api/{{requestApiKey}}")
void getFullState(String requestApiKey);
@ -56,14 +56,14 @@ public interface DeConzRestConfig {
/**
* Returns the newest software version available. Starts the update if available (only on raspberry pi).
*/
@WSRequestType(HTTP_POST)
@WSRequestType(POST)
@WSPath("/api/{{requestApiKey}}/config/update")
void updateSoftware(String requestApiKey);
/**
* Starts the update firmware process if newer firmware is available.
*/
@WSRequestType(HTTP_POST)
@WSRequestType(POST)
@WSPath("/api/{{requestApiKey}}/config/updatefirmware")
void updateFirmware(String requestApiKey);
@ -73,7 +73,7 @@ public interface DeConzRestConfig {
* @param resetGW Set the network settings of the gateway to factory new. (optional)
* @param deleteDB Delete the Database. (optional)
*/
@WSRequestType(HTTP_POST)
@WSRequestType(POST)
@WSPath("/api/{{requestApiKey}}/config/reset")
void resetGateway(String requestApiKey, boolean resetGW, boolean deleteDB);
@ -85,14 +85,14 @@ public interface DeConzRestConfig {
* @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(HTTP_PUT)
@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(HTTP_DELETE)
@WSRequestType(DELETE)
@WSPath("/api/{{requestApiKey}}/config/password")
void resetPassword(String requestApiKey);

View file

@ -19,21 +19,21 @@ public interface DeConzRestGroups {
*
* @param name The name of the new group. (required)
*/
@WSRequestType(HTTP_POST)
@WSRequestType(POST)
@WSPath("/api/{{requestApiKey}}/groups")
void createGroup(String requestApiKey, String name);
/**
* Returns a list of all groups.
*/
@WSRequestType(HTTP_GET)
@WSRequestType(GET)
@WSPath("/api/{{requestApiKey}}/groups")
void getGroups(String requestApiKey);
/**
* Returns the full state of a group.
*/
@WSRequestType(HTTP_GET)
@WSRequestType(GET)
@WSPath("/api/{{requestApiKey}}/groups/{{groupId}}")
void getGroup(String requestApiKey, int groupId);
@ -46,7 +46,7 @@ public interface DeConzRestGroups {
* @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(HTTP_PUT)
@WSRequestType(PUT)
@WSPath("/api/{{requestApiKey}}/groups/{{groupId}}")
void setGroup(String requestApiKey, int groupId, String name, List lights, boolean hidden, List lightSequence, List multiDeviceIds);
@ -65,14 +65,14 @@ public interface DeConzRestGroups {
* @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(HTTP_PUT)
@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(HTTP_DELETE)
@WSRequestType(DELETE)
@WSPath("/api/{{requestApiKey}}/groups/{{groupId}}")
void deleteGroup(String requestApiKey, int groupId);

View file

@ -17,14 +17,14 @@ public interface DeConzRestLights {
/**
* Returns a list of all lights.
*/
@WSRequestType(HTTP_GET)
@WSRequestType(GET)
@WSPath("/api/{{requestApiKey}}/lights")
void getLights(String requestApiKey);
/**
* Returns the full state of a light.
*/
@WSRequestType(HTTP_GET)
@WSRequestType(GET)
@WSPath("/api/{{requestApiKey}}/lights/{{lightId}")
void getLight(String requestApiKey, int lightId);
@ -33,7 +33,7 @@ public interface DeConzRestLights {
*
* @param name Set the name of the light. (required)
*/
@WSRequestType(HTTP_PUT)
@WSRequestType(PUT)
@WSPath("/api/{{requestApiKey}}/lights/{{lightId}")
void setLight(String requestApiKey, int lightId, String name);
@ -52,7 +52,7 @@ public interface DeConzRestLights {
* @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(HTTP_GET)
@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);
@ -61,21 +61,21 @@ public interface DeConzRestLights {
*
* @param reset If true sends a network leave command to the light device (may not supported by each manufacturer). (optional)
*/
@WSRequestType(HTTP_PUT)
@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(HTTP_DELETE)
@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(HTTP_DELETE)
@WSRequestType(DELETE)
@WSPath("/api/{{requestApiKey}}/lights/{{lightId}/scenes")
void deleteScenes(String requestApiKey, int lightId);
}

View file

@ -35,14 +35,14 @@ public interface DeConzRestRules {
/**
* Returns a list of all rules. If there are no rules in the system then an empty object {} will be returned.
*/
@WSRequestType(HTTP_GET)
@WSRequestType(GET)
@WSPath("/api/{{requestApiKey}}/rules")
void getRules(String requestApiKey);
/**
* Returns the rule with the specified id.
*/
@WSRequestType(HTTP_GET)
@WSRequestType(GET)
@WSPath("/api/{{requestApiKey}}/rules/{{ruleId}}")
void getRule(String requestApiKey, int ruleId);
@ -65,7 +65,7 @@ public interface DeConzRestRules {
//@WSPath("/api/{{requestApiKey}}/rules/{{ruleId}}")
//void setRule(String requestApiKey, int ruleId, String name, int periodic, String status, List actions, List conditions);
@WSRequestType(HTTP_DELETE)
@WSRequestType(DELETE)
@WSPath("/api/{{requestApiKey}}/rules/{{ruleId}}")
void deleteRule(String requestApiKey, int ruleId);
}

View file

@ -17,21 +17,21 @@ public interface DeConzRestScenes {
*
* @param name The name of the new scene. (required)
*/
@WSRequestType(HTTP_POST)
@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(HTTP_GET)
@WSRequestType(GET)
@WSPath("/api/{{requestApiKey}}/groups/{{group_id}}/scenes")
void getScenes(String requestApiKey, int groupId);
/**
* Returns all attributes of a scene.
*/
@WSRequestType(HTTP_GET)
@WSRequestType(GET)
@WSPath("/api/{{requestApiKey}}/groups/{{group_id}}/scenes/{{sceneId}}")
void getScene(String requestApiKey, int groupId, int sceneId);
@ -40,14 +40,14 @@ public interface DeConzRestScenes {
*
* @param name Name of the scene. (optional)
*/
@WSRequestType(HTTP_PUT)
@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(HTTP_PUT)
@WSRequestType(PUT)
@WSPath("/api/{{requestApiKey}}/groups/{{group_id}}/scenes/{{sceneId}}/store")
String storeScene(String requestApiKey, int groupId, int sceneId);
@ -55,7 +55,7 @@ public interface DeConzRestScenes {
* 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(HTTP_PUT)
@WSRequestType(PUT)
@WSPath("/api/{{requestApiKey}}/groups/{{group_id}}/scenes/{{sceneId}}/recall")
void recallScene(String requestApiKey, int groupId, int sceneId);
@ -68,14 +68,14 @@ public interface DeConzRestScenes {
* @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(HTTP_PUT)
@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(HTTP_DELETE)
@WSRequestType(DELETE)
@WSPath("/api/{{requestApiKey}}/groups/{{group_id}}/scenes/{{sceneId}}")
void deleteScene(String requestApiKey, int groupId, int sceneId);
}

View file

@ -34,14 +34,14 @@ public interface DeConzRestSchedules {
/**
* Returns a list of all schedules.
*/
@WSRequestType(HTTP_GET)
@WSRequestType(GET)
@WSPath("/api/{{requestApiKey}}/schedules")
List getSchedules(String requestApiKey);
/**
* Returns all attributes of a schedule.
*/
@WSRequestType(HTTP_GET)
@WSRequestType(GET)
@WSPath("/api/{{requestApiKey}}/schedules/{{scheduleId}}")
List getSchedule(String requestApiKey, int scheduleId);
@ -58,14 +58,14 @@ public interface DeConzRestSchedules {
* @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_PUT)
@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(HTTP_DELETE)
@WSRequestType(DELETE)
@WSPath("/api/{{requestApiKey}}/schedules/{{scheduleId}}")
void deleteSchedule(String requestApiKey, int scheduleId);
}

View file

@ -30,21 +30,21 @@ public interface DeConzRestSensors {
* reachable - Bool - default: true
* battery - Number (0..100)
*/
@WSRequestType(HTTP_POST)
@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(HTTP_GET)
@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(HTTP_GET)
@WSRequestType(GET)
@WSPath("/api/{{requestApiKey}}/sensors/{{sensorId}}")
void getSensor(String requestApiKey, int sensorId);
@ -57,7 +57,7 @@ public interface DeConzRestSensors {
* 2 = Two groups mode
* 3 = Color temperature mode
*/
@WSRequestType(HTTP_PUT)
@WSRequestType(PUT)
@WSPath("/api/{{requestApiKey}}/sensors/{{sensorId}}")
void setSensor(String requestApiKey, int sensorId, String name, int mode);
@ -68,7 +68,7 @@ public interface DeConzRestSensors {
* @param reachable The reachable status of the sensor. (optional)
* @param battery The current battery state in percent, only for battery powered devices. (optional)
*/
@WSRequestType(HTTP_PUT)
@WSRequestType(PUT)
@WSPath("/api/{{requestApiKey}}/sensors/{{sensorId}}/config")
void setSensorConfig(String requestApiKey, int sensorId, boolean on, boolean reachable, int battery);
@ -84,14 +84,14 @@ public interface DeConzRestSensors {
* CLIPGenericStatus status Number
* CLIPHumidity humidity Number
*/
@WSRequestType(HTTP_PUT)
@WSRequestType(PUT)
@WSPath("/api/{{requestApiKey}}/sensors/{{sensorId}}/state")
void setSensorState(String requestApiKey, String flag);
/**
* Delete a sensor.
*/
@WSRequestType(HTTP_DELETE)
@WSRequestType(DELETE)
@WSPath("/api/{{requestApiKey}}/sensors/{{sensorId}}/state")
void deleteSensor(String requestApiKey, int sensorId);
}

View file

@ -16,14 +16,14 @@ 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(HTTP_POST)
@WSRequestType(POST)
@WSPath("/api/{{requestApiKey}}/touchlink/scan")
void startDeviceScan(String requestApiKey);
/**
* Returns the results of a touchlink scan.
*/
@WSRequestType(HTTP_GET)
@WSRequestType(GET)
@WSPath("/api/{{requestApiKey}}/touchlink/scan")
void getScanResult(String requestApiKey);
@ -31,7 +31,7 @@ public interface DeConzRestTouchlink {
* 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(HTTP_POST)
@WSRequestType(POST)
@WSPath("/api/{{requestApiKey}}/touchlink/{{touchlinkId}}/identify")
void identifyDevice(String requestApiKey, int touchlinkId);
@ -39,7 +39,7 @@ public interface DeConzRestTouchlink {
* 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(HTTP_POST)
@WSRequestType(POST)
@WSPath("/api/{{requestApiKey}}/touchlink/{{touchlinkId}}/reset")
void resetDevice(String requestApiKey, int touchlinkId);
}