internal JablotronDevice(TurrisDongle dongle, byte type, ushort address) { _turrisDongle = dongle; _type = type; _address = address; AddressString = Address.ToString("00000000"); IsBatteryLow = IsTampered = false; }
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); }
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)); } }
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; } }
internal JablotronSensorDevice(TurrisDongle dongle, byte type, ushort address) : base(dongle, type, address) { IsSensorActivated = false; }
internal JA_80L(TurrisDongle dongle, byte type, ushort address) : base(dongle, type, address) { }
internal TP_82N(TurrisDongle dongle, byte type, ushort address) : base(dongle, type, address) { SetTemperature = 0; ActualTemperature = 0; }
internal AC_88(TurrisDongle dongle, byte type, ushort address) : base(dongle, type, address) { _isRelayOn = false; }
internal RC_86K(TurrisDongle dongle, byte type, ushort address) : base(dongle, type, address) { }
internal UnknownJablotronDevice(TurrisDongle dongle, byte type, ushort address) : base(dongle, type, address) { }
public JA_83P(TurrisDongle dongle, byte type, ushort address) : base(dongle, type, address) { }