Skip to content

Commit 49efc42

Browse files
committed
manual merge
2 parents bde6347 + b082d77 commit 49efc42

File tree

11 files changed

+65
-30
lines changed

11 files changed

+65
-30
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: "[BUG]"
5+
labels: ''
6+
assignees: roddone
7+
8+
---
9+
10+
**Before creating an issue**
11+
1. Check that your devices have the "developer mode" enabled
12+
2. Check that your devices firmwares are up to date
13+
14+
**Describe the bug**
15+
A clear and concise description of what the bug is.
16+
17+
**To Reproduce**
18+
Steps to reproduce the behavior:
19+
1. Creating new Device() ...
20+
2. connection to the device
21+
3. Call to 'XXX' method
22+
4. See error
23+
24+
**Expected behavior**
25+
A clear and concise description of what you expected to happen.
26+
27+
**Stacktrace**
28+
If applicable, add stacktraces to help understand your problem.
29+
30+
**Environment (please complete the following information):**
31+
- OS: [e.g. Windows, Ubuntu, Raspbian, etc.]
32+
- .Net version [e.g. .Net Core 2.1, .Net Framework 4.7, etc.]
33+
34+
**Additional context**
35+
Add any other context about the problem here.

.travis.yml

Lines changed: 0 additions & 8 deletions
This file was deleted.

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@
186186
same "printed page" as the copyright notice for easier
187187
identification within third-party archives.
188188

189-
Copyright 2018 Romain ODDONE
189+
Copyright 2019 Romain ODDONE
190190

191191
Licensed under the Apache License, Version 2.0 (the "License");
192192
you may not use this file except in compliance with the License.

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[![Build Status](https://travis-ci.org/roddone/YeelightAPI.svg?branch=master)](https://travis-ci.org/roddone/YeelightAPI)
1+
[![Build Status](https://romainoddone.visualstudio.com/Github%20Builds/_apis/build/status/YeelightAPI?branchName=master)](https://romainoddone.visualstudio.com/Github%20Builds/_build/latest?definitionId=7&branchName=master)
22
[![NuGet Package](https://img.shields.io/nuget/v/YeelightAPI.svg)](https://www.nuget.org/packages/YeelightAPI/)
33
[![NuGet Downloads](https://img.shields.io/nuget/dt/YeelightAPI.svg)](https://www.nuget.org/packages/YeelightAPI/)
44
[![Donate](https://img.shields.io/badge/%24-donate-ff00ff.svg)](https://www.paypal.me/roddone)
@@ -10,7 +10,8 @@ C# API (.Net) to control Xiaomi Yeelight Color Bulbs
1010
If you find this package useful, please make a gift on Paypal : [https://www.paypal.me/roddone](https://www.paypal.me/roddone)
1111

1212
## Prerequisites
13-
The console project uses C# 7.1 "Async Main Method" Feature, make sure your visual studio version is up to date !
13+
* The console project uses C# 7.1 "Async Main Method" Feature, make sure your visual studio version is up to date !
14+
* [Enable the "developer mode"](https://www.yeelight.com/en_US/developer) on your devices, otherwhise they will neither be discovered nor usable by this API
1415

1516
## Installation
1617
To install the latest release from [NuGet package manager](https://www.nuget.org/packages/YeelightAPI/):

YeelightAPI/Device.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ private static void HandleSmoothValue(ref List<object> parameters, int? smooth)
362362
else
363363
{
364364
parameters.Add("sudden");
365-
parameters.Add(null); // two parameters needed
365+
parameters.Add(0); // two parameters needed
366366
}
367367
}
368368

YeelightAPI/Models/FluentFlow.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public async Task<FluentFlow> Play(ColorFlowEndAction endAction = ColorFlowEndAc
6767
{
6868
CheckExpressions();
6969

70-
ColorFlow.ColorFlow flow = new ColorFlow.ColorFlow(0, endAction, _expressions);
70+
ColorFlow.ColorFlow flow = new ColorFlow.ColorFlow(repetition, endAction, _expressions);
7171

7272
await _startColorFlowMethod(flow);
7373

YeelightAPI/Models/Model.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,13 @@ public enum MODEL
4646
/// Desk Lamp.
4747
/// </summary>
4848
[RealName("desklamp")]
49-
DeskLamp
49+
DeskLamp,
50+
51+
52+
/// <summary>
53+
/// White bulb, supports color temperature adjustment.
54+
/// </summary>
55+
[RealName("ct_bulb")]
56+
TunableWhiteBulb,
5057
}
5158
}

YeelightAPI/YeelightAPI.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<Version>1.6.0</Version>
88
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
99
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
10-
<PackageLicenseUrl>https://raw.githubusercontent.com/roddone/YeelightAPI/master/LICENSE</PackageLicenseUrl>
10+
<PackageLicenseUrl></PackageLicenseUrl>
1111
<PackageProjectUrl>https://github.com/roddone/YeelightAPI</PackageProjectUrl>
1212
<PackageIconUrl>https://github.com/roddone/YeelightAPI/raw/master/YeelightAPI/icon.png</PackageIconUrl>
1313
<RepositoryUrl>https://github.com/roddone/YeelightAPI</RepositoryUrl>
@@ -27,7 +27,7 @@
2727
</ItemGroup>
2828

2929
<ItemGroup>
30-
<PackageReference Include="Newtonsoft.Json" Version="11.0.2" />
30+
<PackageReference Include="Newtonsoft.Json" Version="12.0.2" />
3131
<PackageReference Include="System.Net.NetworkInformation" Version="4.3.0" />
3232
</ItemGroup>
3333

YeelightAPIConsoleTest/Program.cs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ private static async Task<bool> ExecuteTests(IDeviceController device, int? smoo
155155
await Try(async () =>
156156
{
157157
Console.WriteLine("powering on ...");
158-
success = await device.SetPower(true, delay);
158+
success = await device.SetPower(true, smooth);
159159
globalSuccess &= success;
160160
WriteLineWithColor($"command success : {success}", ConsoleColor.DarkCyan);
161161
await Task.Delay(delay);
@@ -164,7 +164,7 @@ await Try(async () =>
164164
await Try(async () =>
165165
{
166166
Console.WriteLine("turn off ...");
167-
success = await device.TurnOff(delay);
167+
success = await device.TurnOff(smooth);
168168
globalSuccess &= success;
169169
WriteLineWithColor($"command success : {success}", ConsoleColor.DarkCyan);
170170
await Task.Delay(delay);
@@ -173,7 +173,7 @@ await Try(async () =>
173173
await Try(async () =>
174174
{
175175
Console.WriteLine("turn on ...");
176-
success = await device.TurnOn(delay, PowerOnMode.RGB);
176+
success = await device.TurnOn(smooth);
177177
globalSuccess &= success;
178178
WriteLineWithColor($"command success : {success}", ConsoleColor.DarkCyan);
179179
await Task.Delay(delay);
@@ -248,7 +248,7 @@ await Try(async () =>
248248
await Try(async () =>
249249
{
250250
Console.WriteLine("powering on ...");
251-
success = await backgroundDevice.BackgroundSetPower(true, delay);
251+
success = await backgroundDevice.BackgroundSetPower(true, smooth);
252252
globalSuccess &= success;
253253
WriteLineWithColor($"command success : {success}", ConsoleColor.DarkCyan);
254254
await Task.Delay(delay);
@@ -257,7 +257,7 @@ await Try(async () =>
257257
await Try(async () =>
258258
{
259259
Console.WriteLine("turn off ...");
260-
success = await backgroundDevice.BackgroundTurnOff(delay);
260+
success = await backgroundDevice.BackgroundTurnOff(smooth);
261261
globalSuccess &= success;
262262
WriteLineWithColor($"command success : {success}", ConsoleColor.DarkCyan);
263263
await Task.Delay(delay);
@@ -266,7 +266,7 @@ await Try(async () =>
266266
await Try(async () =>
267267
{
268268
Console.WriteLine("turn on ...");
269-
success = await backgroundDevice.BackgroundTurnOn(delay, PowerOnMode.RGB);
269+
success = await backgroundDevice.BackgroundTurnOn(smooth, PowerOnMode.RGB);
270270
globalSuccess &= success;
271271
WriteLineWithColor($"command success : {success}", ConsoleColor.DarkCyan);
272272
await Task.Delay(delay);
@@ -275,7 +275,7 @@ await Try(async () =>
275275
await Try(async () =>
276276
{
277277
Console.WriteLine("Setting Brightness to One...");
278-
success = await backgroundDevice.BackgroundSetBrightness(01);
278+
success = await backgroundDevice.BackgroundSetBrightness(1, smooth);
279279
globalSuccess &= success;
280280
WriteLineWithColor($"command success : {success}", ConsoleColor.DarkCyan);
281281
await Task.Delay(delay);
@@ -485,7 +485,7 @@ await Try(async () =>
485485
await Try(async () =>
486486
{
487487
Console.WriteLine("adjust color --");
488-
success=await backgroundDevice.BackgroundAdjustColor(-50, smooth);
488+
success = await backgroundDevice.BackgroundAdjustColor(-50, smooth);
489489
globalSuccess &= success;
490490
WriteLineWithColor($"command success : {success}", ConsoleColor.DarkCyan);
491491
await Task.Delay(delay);
@@ -494,7 +494,7 @@ await Try(async () =>
494494
await Try(async () =>
495495
{
496496
Console.WriteLine("adjust color temperature ++");
497-
success=await backgroundDevice.BackgroundAdjustColorTemperature(50, smooth);
497+
success = await backgroundDevice.BackgroundAdjustColorTemperature(50, smooth);
498498
globalSuccess &= success;
499499
WriteLineWithColor($"command success : {success}", ConsoleColor.DarkCyan);
500500
await Task.Delay(delay);
@@ -503,7 +503,7 @@ await Try(async () =>
503503
await Try(async () =>
504504
{
505505
Console.WriteLine("adjust color temperature --");
506-
success=await backgroundDevice.BackgroundAdjustColorTemperature(-50, smooth);
506+
success = await backgroundDevice.BackgroundAdjustColorTemperature(-50, smooth);
507507
globalSuccess &= success;
508508
WriteLineWithColor($"command success : {success}", ConsoleColor.DarkCyan);
509509
await Task.Delay(delay);
@@ -522,7 +522,7 @@ await Try(async () =>
522522
await Try(async () =>
523523
{
524524
Console.WriteLine("Setting Brightness to One...");
525-
success = await device.SetBrightness(01);
525+
success = await device.SetBrightness(1, smooth);
526526
globalSuccess &= success;
527527
WriteLineWithColor($"command success : {success}", ConsoleColor.DarkCyan);
528528
await Task.Delay(delay);

YeelightAPIConsoleTest/YeelightAPIConsoleTest.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@
3535
<LangVersion>latest</LangVersion>
3636
</PropertyGroup>
3737
<ItemGroup>
38-
<Reference Include="Newtonsoft.Json, Version=11.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
39-
<HintPath>..\packages\Newtonsoft.Json.11.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
38+
<Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
39+
<HintPath>..\packages\Newtonsoft.Json.12.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
4040
</Reference>
4141
<Reference Include="System" />
4242
<Reference Include="System.Core" />
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
3-
<package id="Newtonsoft.Json" version="11.0.2" targetFramework="net46" />
3+
<package id="Newtonsoft.Json" version="12.0.2" targetFramework="net46" />
44
</packages>

0 commit comments

Comments
 (0)