コード例 #1
0
ファイル: HSPI.cs プロジェクト: spudwebb/Sample-Plugin-CS
        protected override void Initialize()
        {
            //Load the state of Settings saved to INI if there are any.
            LoadSettingsFromIni();
            if (LogDebug)
            {
                Console.WriteLine("Registering feature pages");
            }
            //Initialize feature pages
            HomeSeerSystem.RegisterFeaturePage(Id, "sample-guided-process.html", "Sample Guided Process");
            HomeSeerSystem.RegisterFeaturePage(Id, "sample-blank.html", "Sample Blank Page");
            HomeSeerSystem.RegisterFeaturePage(Id, "sample-trigger-feature.html", "Trigger Feature Page");
            HomeSeerSystem.RegisterDeviceIncPage(Id, "add-sample-device.html", "Add Sample Device");

            // If a speaker client is needed that handles sending speech to an audio device, initialize that here.
            // If you are supporting multiple speak devices such as multiple speakers, you would make this call
            // in your reoutine that initializes each speaker device. Create a new instance of the speaker client
            // for each speaker. We simply initalize one here as a sample implementation
            _speakerClient = new SpeakerClient(Name);
            // if the HS system has the setting "No password required for local subnet" enabled, the user/pass passed to Connect are ignored
            // if the connection is from the local subnet, else the user/pass passed here are must exist as a user in the system
            // You will need to allow the user to supply a user/pass in your plugin settings
            // This functions connects your speaker client to the system. Your client will then appear as a speaker client in the system
            // and can be selected as a target for speech and audio in event actions.
            // When the system speaks to your client, your SpeakText function is called in SpeakerClient class
            _speakerClient.Connect("default", "default");

            Console.WriteLine("Initialized");
            Status = PluginStatus.Ok();
        }
コード例 #2
0
ファイル: PlugIn.cs プロジェクト: dk307/HSPI_Tasmota
 protected override void BeforeReturnStatus()
 {
     this.Status = PluginStatus.Ok();
 }
コード例 #3
0
 protected override void Initialize()
 {
     Console.WriteLine("Initialized");
     Status = PluginStatus.Ok();
 }