-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
initial EnvironmentSensor model implementation
- Loading branch information
1 parent
8f17499
commit 9456fec
Showing
4 changed files
with
97 additions
and
0 deletions.
There are no files selected for viewing
38 changes: 38 additions & 0 deletions
38
...r/iot/dirigera/client/api/model/device/environmentsensor/EnvironmentSensorAttributes.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package de.dvdgeisler.iot.dirigera.client.api.model.device.environmentsensor; | ||
|
||
import com.fasterxml.jackson.annotation.JsonUnwrapped; | ||
import de.dvdgeisler.iot.dirigera.client.api.model.device.DeviceAttributes; | ||
import de.dvdgeisler.iot.dirigera.client.api.model.device.ota.OtaAttributes; | ||
|
||
public class EnvironmentSensorAttributes extends DeviceAttributes<EnvironmentSensorStateAttributes> { | ||
public String productCode; | ||
public Boolean permittingJoin; | ||
public Integer currentTemperature; | ||
public Integer currentRH; | ||
public Integer currentPM25; | ||
public Integer maxMeasuredPM25; | ||
public Integer minMeasuredPM25; | ||
public Integer vocIndex; | ||
|
||
@JsonUnwrapped | ||
public OtaAttributes ota; | ||
|
||
public EnvironmentSensorAttributes() { | ||
} | ||
|
||
public EnvironmentSensorAttributes( | ||
final String model, | ||
final String manufacturer, | ||
final String firmwareVersion, | ||
final String hardwareVersion, | ||
final String serialNumber, | ||
final String productCode, | ||
final Boolean permittingJoin, | ||
final EnvironmentSensorStateAttributes state, | ||
final OtaAttributes ota) { | ||
super(model, manufacturer, firmwareVersion, hardwareVersion, serialNumber, state); | ||
this.productCode = productCode; | ||
this.permittingJoin = permittingJoin; | ||
this.ota = ota; | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
...a/client/api/model/device/environmentsensor/EnvironmentSensorConfigurationAttributes.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package de.dvdgeisler.iot.dirigera.client.api.model.device.environmentsensor; | ||
|
||
import de.dvdgeisler.iot.dirigera.client.api.model.device.DeviceConfigurationDefaultAttributes; | ||
import de.dvdgeisler.iot.dirigera.client.api.model.deviceset.DeviceSet; | ||
import de.dvdgeisler.iot.dirigera.client.api.model.deviceset.Room; | ||
|
||
import java.util.List; | ||
|
||
public class EnvironmentSensorConfigurationAttributes extends DeviceConfigurationDefaultAttributes { | ||
|
||
public EnvironmentSensorConfigurationAttributes(final String customIcon, final List<DeviceSet> deviceSet, final Boolean isHidden, final Room room) { | ||
super(customIcon, deviceSet, isHidden, room); | ||
} | ||
|
||
public EnvironmentSensorConfigurationAttributes() { | ||
} | ||
} |
29 changes: 29 additions & 0 deletions
29
...isler/iot/dirigera/client/api/model/device/environmentsensor/EnvironmentSensorDevice.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package de.dvdgeisler.iot.dirigera.client.api.model.device.environmentsensor; | ||
|
||
import de.dvdgeisler.iot.dirigera.client.api.model.device.Device; | ||
import de.dvdgeisler.iot.dirigera.client.api.model.device.DeviceCapabilities; | ||
|
||
import java.time.LocalDateTime; | ||
import java.util.List; | ||
|
||
import static de.dvdgeisler.iot.dirigera.client.api.model.device.DeviceCategory.SENSOR; | ||
import static de.dvdgeisler.iot.dirigera.client.api.model.device.DeviceType.ENVIRONMENT_SENSOR; | ||
|
||
public class EnvironmentSensorDevice extends Device<EnvironmentSensorAttributes, EnvironmentSensorConfigurationAttributes> { | ||
|
||
public EnvironmentSensorDevice() { | ||
} | ||
|
||
public EnvironmentSensorDevice( | ||
final String id, | ||
final LocalDateTime createdAt, | ||
final Boolean isReachable, | ||
final LocalDateTime lastSeen, | ||
final EnvironmentSensorAttributes attributes, | ||
final DeviceCapabilities capabilities, | ||
final List<String> remoteLinks, | ||
final EnvironmentSensorConfigurationAttributes environmentSensorConfigurationAttributes | ||
) { | ||
super(id, SENSOR, ENVIRONMENT_SENSOR, createdAt, isReachable, lastSeen, attributes, capabilities, remoteLinks, environmentSensorConfigurationAttributes); | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
.../dirigera/client/api/model/device/environmentsensor/EnvironmentSensorStateAttributes.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package de.dvdgeisler.iot.dirigera.client.api.model.device.environmentsensor; | ||
|
||
import de.dvdgeisler.iot.dirigera.client.api.model.device.DeviceStateAttributes; | ||
|
||
public class EnvironmentSensorStateAttributes extends DeviceStateAttributes { | ||
|
||
public EnvironmentSensorStateAttributes(final String customName) { | ||
super(customName); | ||
} | ||
|
||
public EnvironmentSensorStateAttributes() { | ||
} | ||
} |