I create a demo module which will create an initial record at the setup procedure.
But when I want to add new record, I find that the initial record will automatically updated.
For example, the initial record I create is “HomeConnect Hub” at the setup procedure.
But if I add a new record which is “NEW CREATED”, the initial record will be updated to “NEW CREATED”.
So my questions are:
1.Is there a way to avoid updated the initial record?
2.I tried not to create the initial record at first time, but then run into an internal error. Why does that happen?
I think the initial record is necessary but I do not know the reason.
What it does after that is attempt to create a ‘singleton’ instance of the Home Connect record, in the maybeCreateHCSettings method. What modifications did you make to this example? The 0L primary key is the important part; it’s always referring to records by the HCSETTINGSRECORD_ID. As the module is written, a default record will be created and any editing on the config page will happen on that single record.
For a slightly different approach - say you want to be able to configure additional devices, you can try the secret-keeper module I just wrote up as a proof of concept.
The GatewayHook ensures the required table exists, but does not create any records.
Meanwhile, the SecretManagerPage uses the Ignition API class RecordActionTable to create the default CRUD interaction around a PersistentRecord implementation - you’ll be able to add new records, update existing ones, etc.
Hi @PGriffith, could you provide a link to ‘SecretManagerPage’ (the one in your above comment 404’s)? I am trying to implement the RecordActionTable, but cannot figure out how to get it fully working.
I cannot figure out why, but I am not getting any config panel to show up in my gateway at all. I followed the secret keeper example, but instead created my own config category.
Just sent it, the module is in a running state for me… let me know if you need the code, I have it on github but in a private repository… do you do remote support?
IA doesn’t do remote support for module development, it’s very much a ‘pursue at your own risk’ endeavor. I’ll usually help people get started “on my own time” because more module authors means more modules means more community engagement