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

            importDevices = GetCurrentDevices().ToImmutableDictionary();
        }
コード例 #2
0
 public static string GetName(IHsController HS, int refId)
 {
     try
     {
         return(HS.GetNameByRef(refId));
     }
     catch
     {
         return($"RefId:{refId}");
     }
 }
コード例 #3
0
ファイル: TasmotaDevice.cs プロジェクト: dk307/HSPI_Tasmota
 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));
 }
コード例 #4
0
 protected PluginConfigBase(IHsController HS)
 {
     this.HS      = HS;
     debugLogging = GetValue(DebugLoggingKey, false);
     logToFile    = GetValue(LogToFileKey, false);
 }
コード例 #5
0
 public HomeSeerTarget(IHsController hsController)
 {
     this.loggerWeakReference = new WeakReference <IHsController>(hsController);
 }
コード例 #6
0
ファイル: DeviceBase.cs プロジェクト: dk307/HSPI_Tasmota
 protected DeviceBase(IHsController HS, int refId)
 {
     this.HS = HS;
     RefId   = refId;
 }
コード例 #7
0
ファイル: PluginConfig.cs プロジェクト: dk307/HSPI_Tasmota
 public PluginConfig(IHsController HS) : base(HS)
 {
     this.mQTTServerConfiguration = LoadDBSettings();
 }
コード例 #8
0
 public AnalyticsClient(HSPI plugin, IHsController hs)
 {
     _plugin = plugin;
     _hs     = hs;
 }
コード例 #9
0
 public static void UpdateDeviceValue(IHsController HS, int refId, in double?data)
コード例 #10
0
        public static string?GetDeviceTypeFromPlugInData(IHsController HS, int refId)
        {
            var plugInExtra = HS.GetPropertyByRef(refId, EProperty.PlugExtraData) as PlugExtraData;

            return(GetDeviceTypeFromPlugInData(plugInExtra));
        }