mitch7391 / homebridge-cmd4-AdvantageAir

Catered shell script to integrate air conditioner control units by Advantage Air into HomeKit using the plug-in homebridge-cmd4.
MIT License
38 stars 5 forks source link

[Pull Request] Running ConfigCreator from Custom Homebridge Ui #69

Closed uswong closed 1 year ago

uswong commented 1 year ago

name: Pull Request about: Add an improvement to homebridge-cmd4-AdvantageAir. title: "Running ConfigCreator from customUi" labels: Improvement assignees: mitch7391


The first version of ConfigCreator was run from Terminal and required an intensive find command and super user password. ConfigCreator has now been brought into homebridge-ui environment. It no longer requires the intensive find command nor require any super user password. It is running a lot faster too.

Is your pull request related to a problem or a new feature? Please describe:

It is a major improvement to the existing tool.

Describe the solution you'd have implemented:

  1. Modified config.schema.json file to allow user input of the AdvantageAir devices.
  2. Added codes to index.html to include ConfigCreator button and integrate the config.schema.json, so that both can be displayed on a single Setting page.
  3. Added codes to server.js to allow the running of ConfigCreator.sh bash script within the homebridge-ui enviornment.
  4. Modified ConfigCreator.sh to suite - delete the use of find command, removed interactive user input prompts, etc.

Do your changes pass local testing:

Additional context:

For the first time user, make sure that the AdvantageAir device(s) is/are defined and saved in cmd4-AdvantagaAir config. This can be done on the AdvantageAir Device Settings section of the SETTING page.

Once the AdvantageAir device(s) is/are defined (note that only a maximum of 3 devices can be processed by ConfigCreator) and saved, click the CONFIG CREATOR button to auto-create the Cmd4 configuration file required to run the cmd4-AdvantageAir plugin. Make sure you check the checkbox if you want the fan to be setup as FanSwitch before you click the CONFIG CREATOR button.

Once the configuration is created, you can then use the CHECK CONFIGURATION button to check whether the configuration meets all the requirement.

You can always inspect or edit the configuration created in Cmd4 (not cmd4-AdvantageAir) JASON Config editor if you want.

A sneak peep of the SETTING page is shown below:

image