Skip to content

Commit 6cb6004

Browse files
committed
Added com door tag module
1 parent a928e7f commit 6cb6004

File tree

6 files changed

+22
-31
lines changed

6 files changed

+22
-31
lines changed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ plugins {
1515
}
1616

1717
group 'io.rudolph.netatmo'
18-
version '0.3.0'
18+
version '0.3.1'
1919

2020
repositories {
2121
mavenCentral()

src/main/java/io/rudolph/netatmo/api/common/model/DeviceType.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ object Constant {
1313
const val INDOORMODULE_API_STRING = "NAModule4"
1414
const val THERMOSTAT_API_STRING = "NATherm1"
1515
const val HOMECOACH_API_STRING = "NHC"
16+
const val CAM_DOOR_TAG_API_STRING = "NACamDoorTag"
1617
const val UNKNOWN_API_STRING = "unknown"
1718
}
1819

@@ -28,5 +29,6 @@ enum class DeviceType(val value: String) {
2829
RAINGAUGEMODULE(Constant.RAINGAUGEMODULE_API_STRING),
2930
INDOORMODULE(Constant.INDOORMODULE_API_STRING),
3031
THERMOSTAT(Constant.THERMOSTAT_API_STRING),
32+
CAMDOORTAG(Constant.CAM_DOOR_TAG_API_STRING),
3133
UNKNOWN(Constant.UNKNOWN_API_STRING);
3234
}

src/main/java/io/rudolph/netatmo/api/common/model/Module.kt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo
88
import io.rudolph.netatmo.api.energy.model.module.RelayModule
99
import io.rudolph.netatmo.api.energy.model.module.ThermostatModule
1010
import io.rudolph.netatmo.api.energy.model.module.ValveModule
11+
import io.rudolph.netatmo.api.presence.model.PresenceModule
1112

1213

1314
@JsonTypeInfo(
@@ -22,7 +23,8 @@ import io.rudolph.netatmo.api.energy.model.module.ValveModule
2223
Type(value = ClimateModule::class, name = Constant.INDOORMODULE_API_STRING),
2324
Type(value = ClimateModule::class, name = Constant.OUTDOORMODULE_API_STRING),
2425
Type(value = ClimateModule::class, name = Constant.RAINGAUGEMODULE_API_STRING),
25-
Type(value = ClimateModule::class, name = Constant.WINDMODULE_API_STRING)
26+
Type(value = ClimateModule::class, name = Constant.WINDMODULE_API_STRING),
27+
Type(value = PresenceModule::class, name = Constant.CAM_DOOR_TAG_API_STRING)
2628
)
2729
abstract class Module {
2830

@@ -36,6 +38,7 @@ abstract class Module {
3638
* 60 = full signal
3739
*/
3840
@JsonProperty("rf_status")
41+
@JsonAlias("rf", "rf_status")
3942
open val rfStrength: Int? = null
4043

4144
/**

src/main/java/io/rudolph/netatmo/api/presence/model/Module.kt

Lines changed: 0 additions & 28 deletions
This file was deleted.

src/main/java/io/rudolph/netatmo/api/presence/model/PresenceHome.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,5 @@ data class PresenceHome(
2424
val events: List<Event>? = null,
2525

2626
@JsonProperty("modules")
27-
val modules: List<Module>? = null
27+
val modules: List<PresenceModule>? = null
2828
)
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package io.rudolph.netatmo.api.presence.model
2+
3+
import com.fasterxml.jackson.annotation.JsonProperty
4+
import io.rudolph.netatmo.api.common.model.Module
5+
import java.time.LocalDateTime
6+
7+
8+
data class PresenceModule(
9+
@JsonProperty("last_activity")
10+
val lastActivity: LocalDateTime? = null,
11+
12+
@JsonProperty("status")
13+
val status: String? = null
14+
) : Module()

0 commit comments

Comments
 (0)