Ejemplo n.º 1
0
        public NanoLeafControl(INanoLeafClient nanoLeafClient)
        {
            InitializeComponent();
            _nanoLeafClient = nanoLeafClient;
            int count = 0;

            foreach (var element in NanoLeafSettings.NanoLeafDevices)
            {
                var newbuttonOff = new NanoLeafButton
                {
                    Text    = element.Name + " On",
                    Command = true,
                    Device  = element
                };
                newbuttonOff.Clicked += HandlerButtonClicked;
                GridNanoLeaf.Children.Add(newbuttonOff, count, 1);

                var newbuttonOn = new NanoLeafButton
                {
                    Text    = element.Name + " Off",
                    Command = false,
                    Device  = element
                };
                newbuttonOn.Clicked += HandlerButtonClicked;
                GridNanoLeaf.Children.Add(newbuttonOn, count, 2);

                count++;
            }
        }
Ejemplo n.º 2
0
        public HomeComingPageViewModel(ITCPClient tcpClient, INanoLeafClient nanoLeafClient, IDimScreenService dimScreen)
        //public HomeComingPageViewModel()
        {
            _tcpClient      = tcpClient;
            _nanoLeafClient = nanoLeafClient;
            _dimScreen      = dimScreen;

            //  Create the command - calls Do...Commands.
            homeComingOnCommand  = new Command(DoHomeComingOnCommand);
            homeComingOffCommand = new Command(DoHomeComingOffCommand);
            lightUpScreenCommand = new Command(DoLightUpScreenCommand);
        }
Ejemplo n.º 3
0
        public NanoLeafSettings(INanoLeafClient nanoLeafClient)
        {
            _nanoLeafClient = nanoLeafClient;

            NanoLeafDevices.Add(new NanoLeafDevice
            {
                Name       = "NanoLeaf Wohnzimmer",
                Address    = "192.168.1.136",
                HomeComing = true
            });
            NanoLeafDevices.Add(new NanoLeafDevice
            {
                Name       = "NanoLeaf Küche",
                Address    = "192.168.1.34",
                HomeComing = true
            });
            _nanoLeafClient.LoadAuhtTokenFromSettings();
        }
Ejemplo n.º 4
0
 public LightsPageViewModel(ITCPClient tcpClient, INanoLeafClient nanoLeafClient)
 {
     TcpLightControl = new Contorls.TcpSwitchControl(tcpClient);
     TcpLedControl   = new Contorls.TcpLedControl(tcpClient);
     NanoLeafControl = new Contorls.NanoLeafControl(nanoLeafClient);
 }