Gene (or anyone else with the knowledge)
I am writing a test app at the moment (with a view to making it an interface once the debugging is done)
I need a list of the modules which I have done by making an api call:
public List<Module> GetModules(string host)
{
var url = $"http://{host}/api/HomeAutomation.HomeGenie/Config/Modules.List";
return JsonConvert.DeserializeObject<List<Module>>(this.Get(url));
}
and creating /copying classes to represent the module and group structure.. I also get module properties..
class Module
{
public string Name { get; set; }
public string Description { get; set; }
public string DeviceType { get; set; }
public string Domain { get; set; }
public string Address { get; set; }
public ModuleProperties[] Properties { get; set; }
public string RoutingNode { get; set; }
}
public class ModuleProperties
{
public string Name { get; set; }
public string Description { get; set; }
public string Value { get; set; }
public string UpdateTime { get; set; }
}
I have a test program running in HG, which currently does:
Program.Setup(()=>{
Program.AddFeature("", "Switch,Light", "Module.GUID", "Module Guid","text");
});
As I want to populate modules with a GUID that I can use to identify them.
How do I know from the API what 'features' are available on a module? - or is it possible to set a default value on a feature? (IE 00000-0000-0000 (IE.. blank guid, I know that's not the correct format!) so that I can then find the ones with blank values, ie I haven't yet set it.
I'm also assuming if I take the module and add the additional property to the module properties array and then post that at:
http://ip/api/HomeAutomation.HomeGenie/Config/Modules.Update/it should add the property?
it would be nice if modules had a guid by default however