コード例 #1
0
 internal JablotronDevice(TurrisDongle dongle, byte type, ushort address)
 {
     _turrisDongle = dongle;
     _type         = type;
     _address      = address;
     AddressString = Address.ToString("00000000");
     IsBatteryLow  = IsTampered = false;
 }
コード例 #2
0
        public MainPage()
        {
            InitializeComponent();

            _settings = ApplicationData.Current.LocalSettings;

            _snoc   = new SnocModule();
            _dongle = new TurrisDongle();

            _snocInitTask = _snoc.InitializeAsync(_initializationFailedNotification, null);

            _dongle.MessageReceived += Dongle_MessageReceived;
            _dongleInitTask          = _dongle.InitializeAsync(_initializationFailedNotification,
                                                               _dongle_InitializationFinishedNotification, true);
        }
コード例 #3
0
        public static JablotronDevice Create(TurrisDongle dongle, byte type, ushort address)
        {
            switch (GetDeviceType(type))
            {
            case JablotronDevicType.AC_82:
                return(new AC_82(dongle, type, address));

            case JablotronDevicType.AC_88:
                return(new AC_88(dongle, type, address));

            case JablotronDevicType.JA_80L:
                return(new JA_80L(dongle, type, address));

            case JablotronDevicType.JA_81M:
                return(new JA_81M(dongle, type, address));

            case JablotronDevicType.JA_82SH:
                return(new JA_82SH(dongle, type, address));

            case JablotronDevicType.JA_83M:
                return(new JA_83M(dongle, type, address));

            case JablotronDevicType.JA_83P:
                return(new JA_83P(dongle, type, address));

            case JablotronDevicType.JA_85ST:
                return(new JA_85ST(dongle, type, address));

            case JablotronDevicType.RC_86K:
                return(new RC_86K(dongle, type, address));

            case JablotronDevicType.RC_86K_2nd:
                return(new RC_86K_2nd(dongle, type, address));

            case JablotronDevicType.TP_82N:
                return(new TP_82N(dongle, type, address));

            default:
                return(new UnknownJablotronDevice(dongle, type, address));
            }
        }
コード例 #4
0
 private static void _dongle_InitializationFinishedNotification(TurrisDongle dongle)
 {
     JablotronDevice[] pirs =
         dongle.GetRegisteredDevices().Where(d => d.GetDeviceType().Equals(JablotronDevicType.JA_83P)).ToArray();
     foreach (JA_83P pir in pirs)
     {
         pir.BeaconNotification += Pir_BeaconNotification;
         pir.SensorNotification += Pir_SensorNotification;
     }
     JablotronDevice[] thermostats =
         dongle.GetRegisteredDevices().Where(d => d.GetDeviceType().Equals(JablotronDevicType.TP_82N)).ToArray();
     foreach (TP_82N thermostat in thermostats)
     {
         thermostat.TemperatureMeasuredNotification += Thermostat_TemperatureMeasuredNotification;
         thermostat.TemperatureSetNotification      += Thermostat_TemperatureSetNotification;
     }
     JablotronDevice[] sensors =
         dongle.GetRegisteredDevices().Where(d => d is JablotronSensorDevice).ToArray();
     foreach (JablotronSensorDevice sensor in sensors)
     {
         sensor.BeaconNotification += Pir_BeaconNotification;
         sensor.SensorNotification += Pir_SensorNotification;
     }
 }
コード例 #5
0
 internal JablotronSensorDevice(TurrisDongle dongle, byte type, ushort address) : base(dongle, type, address)
 {
     IsSensorActivated = false;
 }
コード例 #6
0
ファイル: JA_80L.cs プロジェクト: pospanet/TurrisGadgets
 internal JA_80L(TurrisDongle dongle, byte type, ushort address) : base(dongle, type, address)
 {
 }
コード例 #7
0
ファイル: TP_82N.cs プロジェクト: pospanet/TurrisGadgets
 internal TP_82N(TurrisDongle dongle, byte type, ushort address) : base(dongle, type, address)
 {
     SetTemperature    = 0;
     ActualTemperature = 0;
 }
コード例 #8
0
ファイル: AC_88.cs プロジェクト: pospanet/TurrisGadgets
 internal AC_88(TurrisDongle dongle, byte type, ushort address) : base(dongle, type, address)
 {
     _isRelayOn = false;
 }
コード例 #9
0
 internal RC_86K(TurrisDongle dongle, byte type, ushort address) : base(dongle, type, address)
 {
 }
コード例 #10
0
 internal UnknownJablotronDevice(TurrisDongle dongle, byte type, ushort address) : base(dongle, type, address)
 {
 }
コード例 #11
0
 public JA_83P(TurrisDongle dongle, byte type, ushort address) : base(dongle, type, address)
 {
 }