Skip to content

Commit

Permalink
Ajout des commentaire
Browse files Browse the repository at this point in the history
  • Loading branch information
j0nathan33 committed Nov 15, 2017
1 parent d60154e commit 9d47b0f
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 0 deletions.
18 changes: 18 additions & 0 deletions VeraNet/Objects/Devices/DoorLock.cs
Expand Up @@ -6,9 +6,19 @@
namespace VeraNet.Objects.Devices
{
[VeraDevice(DeviceCategory.Doorlock)]
/// <summary>
/// Represent a DoorLock
/// </summary>
public class DoorLock : Device
{
/// <summary>
/// Get door is locked
/// </summary>
public bool Locked { get; internal set; }

/// <summary>
/// Check if device is responding
/// </summary>
public bool CommFailure { get; internal set; }

internal override void InitializeProperties(Dictionary<string, object> values)
Expand All @@ -25,11 +35,19 @@ internal override void UpdateProperties(Dictionary<string, object> values)
this.UpdateProperty(values, "locked", "Locked", (v) => { this.Locked = (bool)(v.ToString() == "1"); return true; });
}

/// <summary>
/// Lock door
/// </summary>
/// <returns></returns>
public bool LockDoor()
{
return this.SetActionAndWaitJob("urn:micasaverde-com:serviceId:DoorLock1", "SetTarget", "newTargetValue", 1);
}

/// <summary>
/// Unlock door
/// </summary>
/// <returns></returns>
public bool UnLockDoor()
{
return this.SetActionAndWaitJob("urn:micasaverde-com:serviceId:DoorLock1", "SetTarget", "newTargetValue", 0);
Expand Down
31 changes: 31 additions & 0 deletions VeraNet/Objects/Devices/Thermostat.cs
Expand Up @@ -6,14 +6,35 @@
namespace VeraNet.Objects.Devices
{
[VeraDevice(DeviceCategory.Thermostat)]
/// <summary>
/// Represent a Thermostat
/// </summary>
public class Thermostat : PowerMeter
{
/// <summary>
/// Termostats state
/// </summary>
public ModeState Hvacstate { get; internal set; }
/// <summary>
/// Thermostats mode
/// </summary>
public ModeTarget Mode { get; internal set; }
/// <summary>
/// Check if device is responding
/// </summary>
public bool CommFailure { get; internal set; }
public Double Setpoint { get; internal set; }
/// <summary>
/// Heat Temperature
/// </summary>
public Double Heat { get; internal set; }
/// <summary>
/// Cool Temperature
/// </summary>
public Double Cool { get; internal set; }
/// <summary>
/// Get temperature of thermostats
/// </summary>
public Double Temperature { get; internal set; }

internal override void InitializeProperties(Dictionary<string, object> values)
Expand Down Expand Up @@ -42,11 +63,21 @@ internal override void UpdateProperties(Dictionary<string, object> values)
this.UpdateProperty(values, "cool", "Cool", (v) => { this.Cool = double.Parse(v.ToString(), System.Globalization.CultureInfo.InvariantCulture); return true; });
}

/// <summary>
/// Set temperature
/// </summary>
/// <param name="temperature">Temperature</param>
/// <returns></returns>
public bool SetTemperature(double temperature)
{
return this.SetActionAndWaitJob("urn:upnp-org:serviceId:TemperatureSetpoint1", "SetCurrentSetpoint", "NewCurrentSetpoint", temperature);
}

/// <summary>
/// Set Thermostats mode
/// </summary>
/// <param name="modeTarget">Thermostats Mode</param>
/// <returns></returns>
public bool SetModeTarget(String modeTarget)
{
return this.SetActionAndWaitJob("urn:upnp-org:serviceId:HVAC_UserOperatingMode1", "SetModeTarget", "NewModeTarget", modeTarget);
Expand Down

0 comments on commit 9d47b0f

Please sign in to comment.