Exemplo n.º 1
0
        public override void Initialize()
        {
            _synth = new SpeechSynthesizer();

            plugin_settings  ps  = new plugin_settings
            {
                name = "ANNOUCEOPTIONS",
                friendly_name = "Announce options",
                value = "Level",
                value_data_type = (int)Data_Types.LIST,
                description = "Select the values you would like announced."
            };
            ps.plugin_setting_options.Add(new plugin_setting_options { option = "Switch Level" } );
            ps.plugin_setting_options.Add(new plugin_setting_options { option = "Dimmer Level" } );
            ps.plugin_setting_options.Add(new plugin_setting_options { option = "Thermostat Operating State and Temp" } );
            ps.plugin_setting_options.Add(new plugin_setting_options { option = "All of the above" } );
            ps.plugin_setting_options.Add(new plugin_setting_options { option = "Custom" } );
            DefineOrUpdateSetting(ps);

            DefineOrUpdateSetting(new plugin_settings
            {
                name = "CUSTOMVALUES",
                friendly_name = "Announce on custom values",
                value = "DIMMER:Basic, THERMOSTAT:Temperature, SWITCH:Basic, THERMOSTAT:Operating State",
                value_data_type = (int)Data_Types.STRING,
                description = "Include all values you would like announced. (DEVICE_TYPE_NAME:VALUE_LABEL_NAME) Comma Seperated."
            });
        }
Exemplo n.º 2
0
 public void DefineOrUpdateSetting(plugin_settings ps)
 {
     using (zvsEntities2 db = new zvsEntities2(zvsEntityControl.GetzvsConnectionString))
     {
         plugin pl = db.plugins.FirstOrDefault(p => p.name == this._name);
         if (pl != null)
         {
             plugin_settings existing_ps = pl.plugin_settings.FirstOrDefault(pls => pls.name == ps.name);
             if (existing_ps == null)
             {
                 pl.plugin_settings.Add(ps);
             }
             else
             {
                 existing_ps.description = ps.description;
                 existing_ps.friendly_name = ps.friendly_name;
                 existing_ps.name = ps.name;
                 existing_ps.value_data_type = ps.value_data_type;
             }
             db.SaveChanges();
         }
     }
 }
Exemplo n.º 3
0
 /// <summary>
 /// Deprecated Method for adding a new object to the plugin_settings EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToplugin_settings(plugin_settings plugin_settings)
 {
     base.AddObject("plugin_settings", plugin_settings);
 }
Exemplo n.º 4
0
 /// <summary>
 /// Create a new plugin_settings object.
 /// </summary>
 /// <param name="id">Initial value of the id property.</param>
 /// <param name="plugin_id">Initial value of the plugin_id property.</param>
 /// <param name="friendly_name">Initial value of the friendly_name property.</param>
 /// <param name="value">Initial value of the value property.</param>
 /// <param name="value_data_type">Initial value of the value_data_type property.</param>
 public static plugin_settings Createplugin_settings(global::System.Int64 id, global::System.Int64 plugin_id, global::System.String friendly_name, global::System.String value, global::System.Int64 value_data_type)
 {
     plugin_settings plugin_settings = new plugin_settings();
     plugin_settings.id = id;
     plugin_settings.plugin_id = plugin_id;
     plugin_settings.friendly_name = friendly_name;
     plugin_settings.value = value;
     plugin_settings.value_data_type = value_data_type;
     return plugin_settings;
 }