Ejemplo n.º 1
0
        public void SetColor(TrustColorRgb color)
        {
            var value   = new TrustXyValue(color.ToXyz().ToYxy());
            var result  = value.ToValue();
            var command = TrustCommand.SimpleCommand(Home.Mac, Home.AesKey, Convert.ToInt32(Id), 5, result);

            TrustHttp.SendCommand(Home.Mac, Hub.Email, Hub.Password, command);
        }
Ejemplo n.º 2
0
        public TrustHub(string macAddress, string email, string password)
        {
            MacAddress = macAddress;
            Email      = email;
            Password   = password;
            var baseTrustDevices = TrustHttp.GetHubDevices(MacAddress, Email, Password);
            var devices          = baseTrustDevices.Select(baseTrustDevice => new TrustDevice(this, baseTrustDevice)).ToList();

            Devices = devices.ToArray();
            User    = new TrustUser(this, TrustHttp.LoginUser(MacAddress, Email, Password));

            // get groups
            Groups = Devices
                     .Where(d => d.Data.group != null)
                     .Select(d => new TrustDeviceGroup(this, d.Data.group, d.Base))
                     .ToArray();
        }
Ejemplo n.º 3
0
 public static TrustHub GetHub(string macAddress, string email, string password)
 {
     return(TrustHttp.GetHub(macAddress, email, password));
 }
Ejemplo n.º 4
0
        public void TurnOff()
        {
            var command = TrustCommand.SimpleCommand(Home.Mac, Home.AesKey, Convert.ToInt32(Id), 3, 0);

            TrustHttp.SendCommand(Home.Mac, Hub.Email, Hub.Password, command);
        }