https://github.com/usausa/devicelib-wfwattch2
RS-WFWATTCH2 library.
https://github.com/usausa/devicelib-wfwattch2
device power-consumption wfwattch2
Last synced: 5 days ago
JSON representation
RS-WFWATTCH2 library.
- Host: GitHub
- URL: https://github.com/usausa/devicelib-wfwattch2
- Owner: usausa
- License: mit
- Created: 2024-10-04T00:23:51.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2025-02-15T06:41:53.000Z (3 months ago)
- Last Synced: 2025-04-19T17:25:54.972Z (about 1 month ago)
- Topics: device, power-consumption, wfwattch2
- Language: C#
- Homepage:
- Size: 50.8 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# RS-WFWATTCH2 library
| Package | Info |
|:-|:-|
| DeviceLib.WFWattch2 | [](https://www.nuget.org/packages/DeviceLib.WFWattch2) |## Usage
```csharp
using DeviceLib.WFWattch2;using var client = new WattchClient(IPAddress.Parse("192.168.1.101"));
await client.ConnectAsync(cts.Token).ConfigureAwait(false);using var timer = new PeriodicTimer(TimeSpan.FromSeconds(1));
while (await timer.WaitForNextTickAsync().ConfigureAwait(false))
{
if (await client.UpdateAsync(cts.Token).ConfigureAwait(false))
{
Console.WriteLine(
$"{client.DateTime:yyyy/MM/dd HH:mm:ss}: " +
$"Power={client.Power:F2}W, " +
$"Voltage={client.Voltage:F2}V, " +
$"Current={client.Current * 1000.0:F0}mA");
}
}
```## Globalt tool
### Install
```
> dotnet tool install -g DeviceTool.WFWattch2
```### Usage
```
wfwatch2 measure -h 192.168.1.101
```