Skip to content

Commit

Permalink
Merge pull request #30 from Bounz/master
Browse files Browse the repository at this point in the history
Changed the way how CentralSceneValue is serialized
  • Loading branch information
genemars authored Sep 24, 2018
2 parents 1f59819 + b116c1f commit 35f6007
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@ Thumbs.db
packages/*
!packages/repositories.config

\.vs/
# VisualStudio For Mac
.vs/**/*
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ controller.DiscoveryProgress += Controller_DiscoveryProgress;
controller.NodeOperationProgress += Controller_NodeOperationProgress;
controller.NodeUpdated += Controller_NodeUpdated;

// Open connection
controller.Connect();

// Issue some commands on a dimmer and a thermostat node
var dimmer = controller.GetNode(4);
Expand Down
6 changes: 3 additions & 3 deletions ZWaveLib/Values/CentralSceneValue.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*
/*
This file is part of ZWaveLib (https://github.com/genielabs/zwave-lib-dotnet)
Copyright (2012-2018) G-Labs (https://github.com/genielabs)
Expand Down Expand Up @@ -58,10 +58,10 @@ public static CentralSceneValue Parse(byte[] message)
};

}

public override string ToString()
{
return $"SceneId: {SceneId}, Level: {Level}, PressType: {PressType}";
return $"{{\"SceneId\":{SceneId}, \"Level\":{Level}, \"PressType\":\"{PressType}\"}}";
}
}
}
2 changes: 1 addition & 1 deletion ZWaveLib/ZWaveController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ public void Connect()
/// </summary>
public void Disconnect()
{
new Thread(() => { serialPort.Disconnect(); }).Start();
serialPort.Disconnect();
}

/// <summary>
Expand Down

0 comments on commit 35f6007

Please sign in to comment.