Exemplo n.º 1
0
        public TasmotaDeviceManager(IHsController HS,
                                    MqttServerDetails hostedMQTTServerDetails,
                                    CancellationToken cancellationToken)
        {
            this.HS = HS;
            this.hostedMQTTServerDetails = hostedMQTTServerDetails;
            this.combinedToken           = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken);

            importDevices = GetCurrentDevices().ToImmutableDictionary();
        }
Exemplo n.º 2
0
 public static string GetName(IHsController HS, int refId)
 {
     try
     {
         return(HS.GetNameByRef(refId));
     }
     catch
     {
         return($"RefId:{refId}");
     }
 }
Exemplo n.º 3
0
 public TasmotaDevice(IHsController HS,
                      int refId,
                      MqttServerDetails hostedServerDetails,
                      CancellationToken cancellationToken)
     : base(HS, refId)
 {
     this.hostedServerDetails = hostedServerDetails;
     this.cancellationToken   = cancellationToken;
     Utils.TaskHelper.StartAsyncWithErrorChecking(Invariant($"Device Start {refId}"),
                                                  UpdateDeviceProperties,
                                                  cancellationToken,
                                                  TimeSpan.FromSeconds(15));
 }
Exemplo n.º 4
0
 protected PluginConfigBase(IHsController HS)
 {
     this.HS      = HS;
     debugLogging = GetValue(DebugLoggingKey, false);
     logToFile    = GetValue(LogToFileKey, false);
 }
Exemplo n.º 5
0
 public HomeSeerTarget(IHsController hsController)
 {
     this.loggerWeakReference = new WeakReference <IHsController>(hsController);
 }
Exemplo n.º 6
0
 protected DeviceBase(IHsController HS, int refId)
 {
     this.HS = HS;
     RefId   = refId;
 }
Exemplo n.º 7
0
 public PluginConfig(IHsController HS) : base(HS)
 {
     this.mQTTServerConfiguration = LoadDBSettings();
 }
Exemplo n.º 8
0
 public AnalyticsClient(HSPI plugin, IHsController hs)
 {
     _plugin = plugin;
     _hs     = hs;
 }
Exemplo n.º 9
0
 public static void UpdateDeviceValue(IHsController HS, int refId, in double?data)
Exemplo n.º 10
0
        public static string?GetDeviceTypeFromPlugInData(IHsController HS, int refId)
        {
            var plugInExtra = HS.GetPropertyByRef(refId, EProperty.PlugExtraData) as PlugExtraData;

            return(GetDeviceTypeFromPlugInData(plugInExtra));
        }