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

            importDevices = GetCurrentDevices().ToImmutableDictionary();
        }
Exemple #2
0
 public static string GetName(IHsController HS, int refId)
 {
     try
     {
         return(HS.GetNameByRef(refId));
     }
     catch
     {
         return($"RefId:{refId}");
     }
 }
Exemple #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));
 }
Exemple #4
0
 protected PluginConfigBase(IHsController HS)
 {
     this.HS      = HS;
     debugLogging = GetValue(DebugLoggingKey, false);
     logToFile    = GetValue(LogToFileKey, false);
 }
Exemple #5
0
 public HomeSeerTarget(IHsController hsController)
 {
     this.loggerWeakReference = new WeakReference <IHsController>(hsController);
 }
Exemple #6
0
 protected DeviceBase(IHsController HS, int refId)
 {
     this.HS = HS;
     RefId   = refId;
 }
Exemple #7
0
 public PluginConfig(IHsController HS) : base(HS)
 {
     this.mQTTServerConfiguration = LoadDBSettings();
 }
Exemple #8
0
 public AnalyticsClient(HSPI plugin, IHsController hs)
 {
     _plugin = plugin;
     _hs     = hs;
 }
Exemple #9
0
 public static void UpdateDeviceValue(IHsController HS, int refId, in double?data)
Exemple #10
0
        public static string?GetDeviceTypeFromPlugInData(IHsController HS, int refId)
        {
            var plugInExtra = HS.GetPropertyByRef(refId, EProperty.PlugExtraData) as PlugExtraData;

            return(GetDeviceTypeFromPlugInData(plugInExtra));
        }