[netatmo] Consider setpoint duration when manual changing the setpoint temperature (#17662)

* setpointDefaultDuration was not always considered

Signed-off-by: Gaël L'hopital <gael@lhopital.org>
This commit is contained in:
Gaël L'hopital 2024-11-06 09:22:04 +01:00 committed by GitHub
parent 51be3b258c
commit 41c8c45e18
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 20 additions and 8 deletions

View File

@ -480,7 +480,14 @@ All channels are read only.
| security | unknown-person-count | Number | Total number of unknown persons that are at home | | security | unknown-person-count | Number | Total number of unknown persons that are at home |
| security | unknown-person-picture | Image | Snapshot of unknown person that is at home | | security | unknown-person-picture | Image | Snapshot of unknown person that is at home |
**Supported trigger channels for the Security Home thing:** **Supported channels for the Energy Home thing:**
| Channel Group | Channel Id | Item Type | Read/Write | Description |
| ------------- | ---------------------- | ----------- |----------- | --------------------------------------------------------- |
| energy | setpoint-duration | Number:Time | Read-only | Default duration of manual setpoint changes |
| energy | planning | String | Read-write | Planning currently applied when following weekly schedule |
| energy | mode | String | Read-write | Chosen thermostat mode (home, frost guard, manual, max) |
| energy | end | DateTime | Read-only | End time of the currently applied thermostat mode |
**Supported trigger channels for the Security Home, Presence and Doorbell thing:** **Supported trigger channels for the Security Home, Presence and Doorbell thing:**

View File

@ -147,6 +147,10 @@ public class EnergyCapability extends RestCapability<EnergyApi> {
} }
api.setThermMode(energyId, targetMode.apiDescriptor); api.setThermMode(energyId, targetMode.apiDescriptor);
break; break;
case CHANNEL_SETPOINT_DURATION:
logger.info("'{}' is a read-only channel that must be updated in the Netatmo App",
CHANNEL_SETPOINT_DURATION);
break;
} }
handler.expireData(); handler.expireData();
} catch (NetatmoException e) { } catch (NetatmoException e) {

View File

@ -113,10 +113,10 @@ public class HomeCapability extends CacheCapability<HomeApi> {
List<NAObject> result = new ArrayList<>(); List<NAObject> result = new ArrayList<>();
homeIds.stream().filter(id -> !id.isEmpty()).forEach(id -> { homeIds.stream().filter(id -> !id.isEmpty()).forEach(id -> {
try { try {
if (firstLaunch) {
HomeData homeData = api.getHomeData(id); HomeData homeData = api.getHomeData(id);
if (homeData != null) { if (homeData != null) {
result.add(homeData); result.add(homeData);
if (featureAreas.isEmpty()) {
featureAreas.addAll(homeData.getFeatures()); featureAreas.addAll(homeData.getFeatures());
} }
} }

View File

@ -16,7 +16,7 @@ channel-group-type.netatmo.battery-extended.label = Battery
channel-group-type.netatmo.battery.label = Battery channel-group-type.netatmo.battery.label = Battery
channel-group-type.netatmo.energy.label = Home Energy channel-group-type.netatmo.energy.label = Home Energy
channel-group-type.netatmo.energy.channel.end.label = Mode End channel-group-type.netatmo.energy.channel.end.label = Mode End
channel-group-type.netatmo.energy.channel.end.description = End time of the currently applied setpoint. channel-group-type.netatmo.energy.channel.end.description = End time of the currently applied thermostat mode.
channel-group-type.netatmo.humidity.label = Humidity channel-group-type.netatmo.humidity.label = Humidity
channel-group-type.netatmo.last-event-alarm.label = Last Event channel-group-type.netatmo.last-event-alarm.label = Last Event
channel-group-type.netatmo.last-event-alarm.channel.time.label = Event Timestamp channel-group-type.netatmo.last-event-alarm.channel.time.label = Event Timestamp

View File

@ -135,7 +135,8 @@
<label>Setpoint Duration</label> <label>Setpoint Duration</label>
<description>Default duration of manual setpoint changes.</description> <description>Default duration of manual setpoint changes.</description>
<category>Time</category> <category>Time</category>
<state pattern="%d %unit%" min="5" max="720" step="5"/> <state pattern="%d %unit%" min="5" max="720" step="5" readOnly="true"/>
<autoUpdatePolicy>veto</autoUpdatePolicy>
</channel-type> </channel-type>
<channel-type id="floodlight-mode"> <channel-type id="floodlight-mode">

View File

@ -51,7 +51,7 @@
<channel id="mode" typeId="energy-mode"/> <channel id="mode" typeId="energy-mode"/>
<channel id="end" typeId="timestamp"> <channel id="end" typeId="timestamp">
<label>Mode End</label> <label>Mode End</label>
<description>End time of the currently applied setpoint.</description> <description>End time of the currently applied thermostat mode.</description>
</channel> </channel>
</channels> </channels>
</channel-group-type> </channel-group-type>