beyarkay / eskom-calendar

Get your loadshedding schedule in your calendar and never be left in the dark! Open-source, up-to-date, and developer friendly.
https://eskomcalendar.co.za
GNU General Public License v3.0
190 stars 35 forks source link

update city power schedules to 2023 rev 0 #489

Closed declan-fitzpatrick closed 11 months ago

declan-fitzpatrick commented 11 months ago

Update for #488

:information_source: City Power revised the blocks as well as the schedules. Generated names have been kept the same generated/city-power-x.csv for consistency, but will require users in revised blocks to update calendars or automations that are using this repo.

beyarkay commented 11 months ago

Thanks for the PR! Checking it out now...

declan-fitzpatrick commented 11 months ago

Not sure how you do the area search on https://eskomcalendar.co.za, that will also need to be updated

beyarkay commented 11 months ago

The area search on eskomcalendar.co.za is powered by a frankly horrendous YAML file in this repo, https://github.com/beyarkay/eskom-calendar/blob/main/area_metadata.yaml. It basically takes care of the question "what calendar is associated with this suburb/area/town", but that question gets really messy because Eskom and the municipalities treat things differently.

I've got something in the works to replace that (and also to improve the website a ton), but it's not ready yet and has also been put on hold until after the MSc.

The website will still show the updated schedules when this PR is merged if you go directly to the correct URL, but you won't be able to search for each schedule by giving it your suburb (although if you search directly for the calendar name like city-power-x then all will work okay).

If you want to take a crack at the area_metadata.yaml editing:

  1. If you haven't used YAML before, it's pretty easy despite the syntax looking weird. After you've made a change, run yamllint on the file with the command yamllint --config-file .area_metadata.yamllint area_metadata.yaml and lots of the silly mistakes will get caught (you should have no warnings and no errors)
  2. You'll want to edit all the objects starting with calendar_name: city-power-X.ics, like the one here: https://github.com/beyarkay/eskom-calendar/blob/main/area_metadata.yaml#L3790
  3. The values for source will need to be to the URL of the new schedules. (source_info just points to the "main" website for that area/municipalities loadshedding schedules, in case the URL to the PDF gets deleted and we want to figure out where the new schedules might be)
  4. The values for areas will need to be updated to have a list of the names of areas which are related to the schedule. So if city-power-1 now shows the schedule for the suburbs Foo and Bar and Baz, then the areas should become:
    ...
    areas:
    - {name: "Foo"}
    - {name: "Bar"}
    - {name: "Baz"}

After that, everything should work. And the website will get updated immediately once the PR is merged into main.

beyarkay commented 11 months ago

LGTM!

@all-contributors please add @declan-fitzpatrick for data and maintenance

allcontributors[bot] commented 11 months ago

@beyarkay

I've put up a pull request to add @declan-fitzpatrick! :tada: