„98_TadoAPI.pm“ ändern

added ZoneIDs to readings - some code cleanup
This commit is contained in:
Philipp Wo 2023-02-13 14:33:29 +00:00
parent 16ff369335
commit e3c6c6819f
1 changed files with 12 additions and 16 deletions

View File

@ -1,5 +1,5 @@
#===============================================================================
# $Id: 98_TadoAPI.pm 105 2019-12-27 15:58:26Z psycho160 $
# $Id: 98_TadoAPI.pm 106 2022-02-13 15:34:28Z psycho160 $
#
# FILE: 98_TadoAPI.pm
#
@ -16,9 +16,9 @@
# NOTES: https://git.wolfmajer.at
# AUTHOR: Philipp Wolfmajer
# ORGANIZATION:
# VERSION: 0.9
# VERSION: 1.0
# CREATED: 04/12/2019
# REVISION: 12/10/2019
# REVISION: 02/13/2023
#===============================================================================
package main;
@ -710,13 +710,13 @@ sub TadoAPI_SetZoneOverlayById {
my $dt = time();
$dt += $duration if defined($duration);
delete( $hash->{helper}{LockedZones}{$zoneID} );
# remove overlay
# remove overlay & lock
if ( $setting eq "remove" ) {
$method = "DELETE";
Log3 $name, 3,
"TadoAPI $name" . ": " . "Deleting Overlay for Zone $zoneID";
delete( $hash->{helper}{LockedZones}{$zoneID} );
}
# turn heating of
@ -778,7 +778,7 @@ sub TadoAPI_SetZoneOverlayById {
Log3 $name, 3, "TadoAPI $name" . ": "
. "Set Timer Overlay for Zone $zoneID with $duration seconds expire.";
# seet lock for this zone
# set lock for this zone
$hash->{helper}{LockedZones}{$zoneID} = "locked";
}
else {
@ -985,16 +985,12 @@ sub TadoAPI_UpdateAllZoneReadingsCallback {
= TadoAPI_GetZoneReadingsById( $hash, $zoneID );
# updates zone readings
readingsBulkUpdate( $hash, "Temperatur_" . $zoneName,
$temperature );
readingsBulkUpdate( $hash, "Luftfeuchtigkeit_" . $zoneName,
$humidity );
readingsBulkUpdate( $hash, "Heizleistung_" . $zoneName,
$currentHeatingPower );
readingsBulkUpdate( $hash, "OverlayType_" . $zoneName,
$overlay );
readingsBulkUpdate( $hash, "DesiredTemp_" . $zoneName,
$desiredTemp );
readingsBulkUpdate( $hash, "ZoneID_" . $zoneName, $zoneID );
readingsBulkUpdate( $hash, "Temperatur_" . $zoneName, $temperature );
readingsBulkUpdate( $hash, "Luftfeuchtigkeit_" . $zoneName, $humidity );
readingsBulkUpdate( $hash, "Heizleistung_" . $zoneName, $currentHeatingPower );
readingsBulkUpdate( $hash, "OverlayType_" . $zoneName, $overlay );
readingsBulkUpdate( $hash, "DesiredTemp_" . $zoneName, $desiredTemp );
# iterate through all devices in zone
my $devices = $zone->{'devices'};