Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update without losing skin.conf (update-script) #58

Closed
Supergamerx3000 opened this issue Aug 16, 2022 · 5 comments
Closed

Update without losing skin.conf (update-script) #58

Supergamerx3000 opened this issue Aug 16, 2022 · 5 comments
Labels
documentation Improvements or additions to documentation enhancement New feature or request support

Comments

@Supergamerx3000
Copy link

if I update the skin, I have to uninstall it and then reinstall it. So my question is, can you build an update script that saves the skin.conf, then installs the update and restores the skin.conf? But that would only work if you didn't change anything in the skin.conf in the course of an update. Otherwise the skin.conf would not be suitable for the new version.

If that were possible, the weather forecast and the radar images would not have to be reimplemented with every update.

@Daveiano Daveiano added enhancement New feature or request support labels Aug 19, 2022
@Daveiano
Copy link
Owner

Daveiano commented Aug 19, 2022

if I update the skin, I have to uninstall it and then reinstall it. So my question is, can you build an update script that saves the skin.conf, then installs the update and restores the skin.conf? But that would only work if you didn't change anything in the skin.conf in the course of an update. Otherwise the skin.conf would not be suitable for the new version.

Well, yes this would be a simple task to write a basic update script, but as you noted, this only works if there are no updates in the skin.conf. Otherwise, these values would also need to be updated (which could be tricky to do in a shell script).

I wonder if there is any chance to make such updates like 'automatically merge the user skin.conf with an updated skin.conf' working with weewx API. I will do some research and also post a weewx-wdc-update.sh script for you to test with the next version ;)

Edit: Note to myself: Perhaps it would be useful for users if I would post the changes (if any) that were made to the skin.conf in every release in the release notes.

@Daveiano Daveiano added the documentation Improvements or additions to documentation label Aug 19, 2022
@Daveiano Daveiano added this to the 2.3.0 milestone Aug 19, 2022
@Daveiano
Copy link
Owner

Daveiano commented Aug 19, 2022

Sorry I did not get this ready before the new 2.2.0 release, but I added a new section to the release notes 'Changes made to skin.conf since 2.1.0', which should make the manual update easier.

@Jterrettaz
Copy link

Jterrettaz commented Aug 26, 2022

There is another way to do to avoid that skin.conf settings are overwritten by an update : copy to weewx.conf the personalized item of the skin.conf.
For instance , for radar images , you can add in weewx.conf

[[WdcReport]]
skin = weewx-wdc
enable = True
lang = en
[[[Extras]]]
radar_img = https://my personalized radar image
radar_url = https://my personalized radar url

you can do the same for any other settings. By adding personalized Display options, weewx.conf will be :

[[WdcReport]]
skin = weewx-wdc
enable = True
lang = en
[[[Extras]]]
radar_img = https://my personalized radar image
radar_url = https://my personalized radar url
[[[DisplayOptions]]]
layout = 'alternative'
table_tile_observations = ... personalized list of tile items

As explained here: https://www.weewx.com/docs/customizing.htm#Processing_order , skin configuration items in weewx.conf will override corresponding items in the skin.conf :

Although it is possible to modify the options at any level, as the user of a skin, it is usually best to keep your modifications in the WeeWX configuration file (weewx.conf) if you can. That way you can apply any fixes or changes when the skin author updates the skin, and your customizations will not be overwritten.

@Daveiano
Copy link
Owner

@Jterrettaz Well, I did not know about this, thank you very much for pointing this out!

I will update the wiki to contain this information.

@Daveiano Daveiano removed this from the 2.3.0 milestone Aug 27, 2022
@Daveiano
Copy link
Owner

I added a section about this in the wiki https://github.com/Daveiano/weewx-wdc/wiki/Configuration#persisting-changes-to-the-skinconf-between-updates and also updated the readme.

@Jterrettaz Thanks again for pointing this out!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request support
Projects
None yet
Development

No branches or pull requests

3 participants