-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathILink.cs
67 lines (42 loc) · 1.96 KB
/
ILink.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
namespace EWeLink.Api
{
using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using EWeLink.Api.Models;
using EWeLink.Api.Models.Devices;
using EWeLink.Api.Models.EventParameters;
using EWeLink.Api.Models.LightThemes;
public interface ILink
{
event Action<ILinkEvent<IEventParameters>>? LanParametersUpdated;
event Action<IDevice>? DiscoveredLanControlDevice;
Uri ApiUri { get; }
Uri OtaUri { get; }
Uri ApiWebSocketUri { get; }
Task<SensorData?> GetDeviceCurrentSensorData(string deviceId);
Task<(string? Email, string? Region)> GetRegion();
Task<IDevice?> GetDevice(string deviceId);
Task<IDevice?> GetDevice(string deviceId, bool noCacheLoad);
int GetDeviceChannelCountByUuid(int uuid);
Task ToggleDevice(string deviceId, ChannelId channel = ChannelId.One);
Task<int> GetDeviceChannelCount(string deviceId);
Task SetDevicePowerState(string deviceId, SwitchStateChange state, ChannelId channel = ChannelId.One);
Task SetLightColor(string deviceId, LightBrightness value);
Task<ILinkWebSocket> OpenWebSocket(CancellationToken cancellationToken = default);
void EnableLanControl();
Task<List<IDevice>> GetDevices();
Task<List<UpdateCheckResult>> CheckAllDeviceUpdates();
Task<List<UpgradeInfo>> CheckDeviceUpdates(IEnumerable<IDevice> devices);
Task<UpdateCheckResult> CheckDeviceUpdate(string deviceId);
Task<string?> GetFirmwareVersion(string deviceId);
Task<Credentials> GetCredentials();
}
public interface ILinkAuthorization
{
event Action<OAuhToken>? OAuthTokenUpdated;
(string Signature, long Seq, string AppId) GetAuthorization();
Task<OAuhToken> GetAccessToken(string code, string redirectUri);
}
}