From 9d47b0f134db59b4c315cfc427dca04f96996290 Mon Sep 17 00:00:00 2001 From: j0nathan33 Date: Tue, 14 Nov 2017 20:42:52 -0500 Subject: [PATCH] Ajout des commentaire --- VeraNet/Objects/Devices/DoorLock.cs | 18 ++++++++++++++++ VeraNet/Objects/Devices/Thermostat.cs | 31 +++++++++++++++++++++++++++ 2 files changed, 49 insertions(+) diff --git a/VeraNet/Objects/Devices/DoorLock.cs b/VeraNet/Objects/Devices/DoorLock.cs index 8a8efa8..9420327 100644 --- a/VeraNet/Objects/Devices/DoorLock.cs +++ b/VeraNet/Objects/Devices/DoorLock.cs @@ -6,9 +6,19 @@ namespace VeraNet.Objects.Devices { [VeraDevice(DeviceCategory.Doorlock)] + /// + /// Represent a DoorLock + /// public class DoorLock : Device { + /// + /// Get door is locked + /// public bool Locked { get; internal set; } + + /// + /// Check if device is responding + /// public bool CommFailure { get; internal set; } internal override void InitializeProperties(Dictionary values) @@ -25,11 +35,19 @@ internal override void UpdateProperties(Dictionary values) this.UpdateProperty(values, "locked", "Locked", (v) => { this.Locked = (bool)(v.ToString() == "1"); return true; }); } + /// + /// Lock door + /// + /// public bool LockDoor() { return this.SetActionAndWaitJob("urn:micasaverde-com:serviceId:DoorLock1", "SetTarget", "newTargetValue", 1); } + /// + /// Unlock door + /// + /// public bool UnLockDoor() { return this.SetActionAndWaitJob("urn:micasaverde-com:serviceId:DoorLock1", "SetTarget", "newTargetValue", 0); diff --git a/VeraNet/Objects/Devices/Thermostat.cs b/VeraNet/Objects/Devices/Thermostat.cs index 3ecaff8..3be2cfd 100644 --- a/VeraNet/Objects/Devices/Thermostat.cs +++ b/VeraNet/Objects/Devices/Thermostat.cs @@ -6,14 +6,35 @@ namespace VeraNet.Objects.Devices { [VeraDevice(DeviceCategory.Thermostat)] + /// + /// Represent a Thermostat + /// public class Thermostat : PowerMeter { + /// + /// Termostats state + /// public ModeState Hvacstate { get; internal set; } + /// + /// Thermostats mode + /// public ModeTarget Mode { get; internal set; } + /// + /// Check if device is responding + /// public bool CommFailure { get; internal set; } public Double Setpoint { get; internal set; } + /// + /// Heat Temperature + /// public Double Heat { get; internal set; } + /// + /// Cool Temperature + /// public Double Cool { get; internal set; } + /// + /// Get temperature of thermostats + /// public Double Temperature { get; internal set; } internal override void InitializeProperties(Dictionary values) @@ -42,11 +63,21 @@ internal override void UpdateProperties(Dictionary values) this.UpdateProperty(values, "cool", "Cool", (v) => { this.Cool = double.Parse(v.ToString(), System.Globalization.CultureInfo.InvariantCulture); return true; }); } + /// + /// Set temperature + /// + /// Temperature + /// public bool SetTemperature(double temperature) { return this.SetActionAndWaitJob("urn:upnp-org:serviceId:TemperatureSetpoint1", "SetCurrentSetpoint", "NewCurrentSetpoint", temperature); } + /// + /// Set Thermostats mode + /// + /// Thermostats Mode + /// public bool SetModeTarget(String modeTarget) { return this.SetActionAndWaitJob("urn:upnp-org:serviceId:HVAC_UserOperatingMode1", "SetModeTarget", "NewModeTarget", modeTarget);