WebThingsIO / addon-list

List of installable add-ons for WebThings Gateway

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Updated addons

opened this issue · comments

I've updated the P1 and MySensors addons.

Do I stil need to inform you, or is this automatically detected?

Also, do I still need the lines below in my addon code?

sys.path.append(path.join(path.dirname(path.abspath(__file__)), 'lib'))

and

_TIMEOUT = 3

__location__ = os.path.realpath(
    os.path.join(os.getcwd(), os.path.dirname(__file__)))

_CONFIG_PATHS = [
    os.path.join(os.path.expanduser('~'), '.webthings', 'config'),
]

if 'MOZIOT_HOME' in os.environ:
    _CONFIG_PATHS.insert(0, os.path.join(os.environ['MOZIOT_HOME'], 'config'))

Do I stil need to inform you, or is this automatically detected?

Yes, you still need to open a PR to this repo. All that changed Is that the packages are built automatically for your add-ons now, rather than me having to build them for you.

However, it looks like your release actions failed because you created a release from GitHub. What you should do instead is this, from your development machine:

git tag 1.1.3
git push --tags

After pushing the tag, GitHub will run the release workflow and create a release, then will build the add-on packages.

Also, do I still need the lines below in my addon code?

sys.path.append(path.join(path.dirname(path.abspath(__file__)), 'lib'))

Yes.

_TIMEOUT = 3

Yes.

__location__ = os.path.realpath(
    os.path.join(os.getcwd(), os.path.dirname(__file__)))

Doesn't look like you're even using that.

_CONFIG_PATHS = [
    os.path.join(os.path.expanduser('~'), '.webthings', 'config'),
]

Yes.

if 'MOZIOT_HOME' in os.environ:
    _CONFIG_PATHS.insert(0, os.path.join(os.environ['MOZIOT_HOME'], 'config'))

You should replace MOZIOT_HOME with WEBTHINGS_HOME.

Hmm, I never use git from the commandline. I always use the web interface.

It also has a tag option when creating a new release. Does that do the same thing?

You can certainly try it. You just need it to create only a tag, not a release.

I've always added a 1.2.3 tag, so if it has worked in the past, then it might be ok.

Noticed that the user profile data still shows mozilla-iot in one case:

User profile data: {'addonsDir': '/home/pi/.webthings/addons', 'baseDir': '/home/pi/.webthings', 'configDir': '/home/pi/.webthings/config', 'dataDir': '/home/pi/.webthings/data', 'mediaDir': '/home/pi/.webthings/media', 'logDir': '/home/pi/.webthings/log', 'gatewayDir': '/home/pi/mozilla-iot/gateway'}

What's the difference between the config, data and media dir? Which of these has their content wiped when the addons is removed, and which doesn't?

I've always added a 1.2.3 tag, so if it has worked in the past, then it might be ok.

Noticed that the user profile data still shows mozilla-iot in one case:

User profile data: {'addonsDir': '/home/pi/.webthings/addons', 'baseDir': '/home/pi/.webthings', 'configDir': '/home/pi/.webthings/config', 'dataDir': '/home/pi/.webthings/data', 'mediaDir': '/home/pi/.webthings/media', 'logDir': '/home/pi/.webthings/log', 'gatewayDir': '/home/pi/mozilla-iot/gateway'}

Yeah, that's just a side effect of the upgrade process and is expected. /home/pi/webthings should also exist, but it's just a symlink to /home/pi/mozilla-iot.

What's the difference between the config, data and media dir? Which of these has their content wiped when the addons is removed, and which doesn't?

  • config is used by the gateway for things like the databases.
  • data is a generic directory for add-ons to use to store data.
  • media is for add-ons to use for things that will be accessed from the web UI.

None of those get wiped when an add-on is removed. The only thing that does is the add-on's directory inside addonsDir.

I see. I recently has a user say that a file that had changed in the addon directory was causing the addon to not start, so that made me hesitant to store data that should be deleted with the addon in the addon directory itself.

The P1 and MySensors addon are now ready, with some additional changes based on the information you provided above.

A new version of Voco has already been uploaded, which also takes those things into account.

Same error as before. As far as I can tell, there is no way to create only a tag through GitHub.

Try merging this PR and then update your version and create a new release. Hopefully that works.

I've also opened these two:

You'll need to update the add-on versions and create a new release like you usually do through GitHub after merging the PRs. Let me know when you've done that and we'll make sure the workflows all ran properly. You'll need to do that for all three:

  • p1-adapter
  • mysensors-adapter
  • Candle-manager

I've updated all three addons, and have created releases or them.

Quick quesions:

  • Can I delete the setup.cfg files?
  • If I create a new release on github, will it matter if I also attach a zipfile along with them?

I've also added some of the code required for the automation process in other addons. If this works, perhaps more can follow this system? E.g. network presence detections, internet radio, highlights, followers?

I've updated all three addons, and have created releases or them.

Looks like all built successfully. I'll open PRs for them shortly.

  • Can I delete the setup.cfg files?

No.

  • If I create a new release on github, will it matter if I also attach a zipfile along with them?

There's no need to do that.

I've also added some of the code required for the automation process in other addons. If this works, perhaps more can follow this system? E.g. network presence detections, internet radio, highlights, followers?

Yes, that would be ideal. I'll try to open PRs later today.

I've opened all the PRs and such.

Brilliant. I've updated all the addons.

  • followers
  • highlights
  • square theme
  • power settings
  • seashell
  • privacy manager
  • display toggle
  • internet radio
  • airport

They have been added now.

*keeps fingers crossed

Ok, privacy-manager is good now. You forgot to create a new release for Voco, though.

On it.

Seashell and Power Settings have also been updated, small bugfixes.

Fix for Voco: createcandle/voco#18

After merging, please generate a new release.

All good now.

Thanks for all your work on this by the way, really great to have all this so optimized.