コード例 #1
0
 public void LightSelectionChanged(ZigBeeEndDevice lightDevice)
 {
     try
     {
         LightDeviceSelectedItem = lightDevice;
     }catch (Exception e)
     {
         Debug.WriteLine("LightSelectionChanged Exception : " + e.Message);
     }
 }
コード例 #2
0
 public void PlugSelectionChanged(ZigBeeEndDevice plugDevice)
 {
     try
     {
         PlugDeviceSelectedItem = plugDevice;
     }
     catch (Exception e)
     {
         Debug.WriteLine("PlugSelectionChanged Exception : " + e.Message);
     }
 }
コード例 #3
0
        protected override DataTemplate SelectTemplateCore(object item, DependencyObject container)
        {
            ZigBeeEndDevice endDevice = item as ZigBeeEndDevice;

            if (endDevice.EndPoints.Count > 1)
            {
                return(MultipleLightTemplate);
            }
            else
            {
                return(SigleLightTemplate);
            }
        }
コード例 #4
0
        private void AllOff(ZigBeeEndDevice endDevice)
        {
            Debug.WriteLine("Call AllOff !! " + endDevice.MacAddress + " # " + endDevice.EndPoints.Count);

            foreach (ZigBeeEndPoint endPoint in endDevice.EndPoints)
            {
                foreach (ZigBeeInCluster ZigBeeInCluster in endPoint.ZigBeeInClusters.Where(z => z.ClusterId == 6))
                {
                    foreach (ZigBeeInClusterAttribute zigBeeInClusterAttribute in ZigBeeInCluster.ZigBeeInClusterAttributes)
                    {
                        if ((bool)zigBeeInClusterAttribute.RealValue)
                        {
                            ToggleOnOff(endPoint);
                        }
                    }
                }
            }
        }
コード例 #5
0
        private void Disconnect(ZigBeeEndDevice endDevice)
        {
            Debug.WriteLine("Call Disconnect !! ");
            if (endDevice == null || false == endDevice.IsConnected)
            {
                return;
            }

            try
            {
                var message = new ValueSet();

                message.Add("Type", "ZWave");
                message.Add("Command", "ManagementLeave");
                message.Add("endDevice", JsonConvert.SerializeObject(endDevice));

                IOTOI.Common.CommonService.GetReturnData(message);
            }
            catch (Exception e)
            {
                Debug.WriteLine(e.Message, "Management Leave Exception : ");
            }
        }
コード例 #6
0
 private void LightSelectionChanged(ZigBeeEndDevice lightDevice)
 {
     LightDeviceSelectedItem = lightDevice;
 }
コード例 #7
0
 private void PlugSelectionChanged(ZigBeeEndDevice plugDevice)
 {
     PlugDeviceSelectedItem = plugDevice;
 }