anthonywebb / homebridge-cbus

CBus plugin for homebridge
MIT License
35 stars 20 forks source link

CLI tool for generating config.json file #32

Open simonhac opened 7 years ago

simonhac commented 7 years ago

it should be pretty straightforward (and mightily helpful for noobs) to create a CLI tool that asks the user as few questions as possible, tests the connection and then creates / modifies config.json automagically.

before making any changes to config.json:

anthonywebb commented 7 years ago

I like this flow, sounds reasonable.

On Sun, Mar 12, 2017 at 5:31 AM, simonhac notifications@github.com wrote:

it should be pretty easy and mightily helpful to create a CLI tool that asks the user a few questions, tests the connection and then creates / modifies the config.json file automagically.

  • ask for client_ip_address, default to 127.0.0.1
  • ask for client_controlport, default to 20023
  • ask for client_cbusname
  • test client connection, if operational, download accessories
  • ask for default client_network, default to 254
  • ask for default client_application, default to 56
  • if config.json doesn't exist, create one
  • if config.json doesn't include a homebridge-cbus platform section, create one
  • ask if user would like all found accessories to be added to config file, if yes, do so.

before making any changes to config.json:

  • create a backup (making sure not to override any existing backups)
  • advise the user of the change and give them the option to leave the CLI without modifying the file

if any error is encountered, restore config.json from the backup.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/anthonywebb/homebridge-cbus/issues/32, or mute the thread https://github.com/notifications/unsubscribe-auth/AAARLfR8pBD__DjYPTUKj2_TQs8xNrUqks5rk-W1gaJpZM4Mahm6 .

simonhac commented 7 years ago

i just updated the first comment.

it might be a bit of a pain to support multiple projects running in the same 'cgate` instance, so i'll assume that there's only one project running. (i'm not sure whether this will limit anyone, but interested to hear otherwise.)

ElphaX commented 7 years ago

Any updates on this tool? If any help is needed hmu :)

greiginsydney commented 4 years ago

I've just published a bash script that builds your entire Pi, and it even creates and edits the config.json, copying the groups across from my-platform.json, one by one, at your direction.

This link jumps directly to the json editing steps, and if you scroll there's an image of it in action.

I think this goes a long way to addressing the requirements above.

All credit to @anthonywebb for the project in the first place, plus all the contributors who've helped built it to what it is today, and to @darylmc whose XLS setup process is the one I've based my script on.

Please let me know if it gives any grief, or if you think it can be improved upon.

- Greig.