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

Nuova API sito GME e riscrittura generale #67

Merged
merged 70 commits into from
Nov 14, 2024
Merged

Nuova API sito GME e riscrittura generale #67

merged 70 commits into from
Nov 14, 2024

Conversation

virtualdj
Copy link
Owner

Versione parzialmente riscritta che sfrutta il nuovo sito web GME.
Non ci sono novità nelle funzionalità, solo nel codice che evita di appoggiarsi al sito storico, che verrà definitivamente abbandonato il 31/12/2024.

Maggiori informazioni nella discussione dell'issue #42 e nella pull-request #45 ormai integrata in questa.

moddroid94 and others added 30 commits May 6, 2024 02:10
semplificazione dei blocchi condizionali
spostata logica per trovare la data del prossimo cambio fascia in get_next_date, snellendo la funzione get_fascia
added vscode env to gitignore

add logger for future use

change in return types to match expect type or fn type return

ordering and cleanup of imports
Imports are already pruned for new code, so there are missing import in this file!
switched base xml parser with defusedxml, as a wrapper of the base parser the sintax doesn't change

fixes for date param format in API endpoint

Better response handling
Tries to load the zip only if the request is 200, otherwise logs the error
moved the actual zip load after await

Bump version, Drop bs4 requirement
inverted logic for time range comparison to use chained comparison
Reasoning: comparing after 23 and before 7 requires or statement while checking between 8 and 19 can use chained comparison, which i think is more easy to understand.
fix for updated fascia
simplify decode fascia def

removed unnecessary override in property

Added Release worflow in Github Actions
With this action pushing on master creates a new patch version 0.0.+1 , we can override the bump with PR release label, or skip the creation of a release on commit with [norelease] in the commit title

Improved request handling and errors exception
fixes

Moved Exctract xml to utils module

[norelease]

bump version in manifest.json

Added exceptions for linting known errors
-PunData holds the list of values for every pun band
-Fascia Enumerates the bands Universally in the code
-PunValues holds the dict of current values for the sensors, this way they are bonded to the enum definition and we can get type checking errors

Main Changes:
Coordinator:
- replaced old for loop with dynamic one using the enum value to set and get pun values, simplified the check and setup of F23
- Removed number of values per pun as a separate dictionary, using len() when needed

Interfaces:
-New file, created Enum and Interfaces nedeed

Sensor:
-replace old static creation with a dynamic loop based on Enum Fascia, this way we can add Bands without having to edit all the various reference
-Replaced definition of self.tipo with self.fascia using

Enum
-Simplified handle_coordinator_update using enum

Utils:
-Updated definitions and type return to Enum Fascia
-Updated return type of exctract_xml to match PunData type
-simplified append match statement with dynamic match

General fixes to types and definitions

moved holidays deps to utils
non functional fixes

Updated wrong type definition for PunSensorEntity

removed unused decode fascia function
correction to fmt_float type definition

possible BREAKING CHANGE, new sensor ids definition

di questa non sono sicuro, bisogna valutare bene che impatto ha sui gli user attuali, e considerata la natura dinamica della definizione dei nomi, nel caso ci fosse una variazione per cause non nostre, quale' l'impatto?
per ora testo il funzionamento.

hotfix missing initialization

Revert for moddroid94@1987711

Cambiare id orfana gli altri sensori e non sembra esserci un helper per fare un merge dei sensori, per ora torniamo al behavior di dafult che non introduce breaking changes.

hotfix per nome sensore prezzo fascia corrente

Hotfixes
fix for error in fascia F23 calculation
better type definition in PunData
removed unused orari dict
removed redundant init

Fixed F23 calculation, again.

Update README.md [norelease]

Test Custom Action

removed old actions

set local version to 0

fix test repo

added requirements file

automatic publishing of draft release

comment edit to test merge.

As documented in https://docs.github.com/en/actions/security-guides/automatic-token-authentication#using-the-github_token-in-a-workflow

using GITHUB_TOKEN in an action won't trigger other actions (to avoid recursive calling) so the release action to upload and publish the draft release created by the drafter won't trigger, moving everything inside this action should make it run and publish everything, with the cost of having a little more runtime and if something fails in the draft the whole action will fail

Revert "fixes to release action"
fix old change
Removed dependency as it will get pushed by action
Un errore nello zip viene gestito come un errore normale
TODO implementare un errore custom in caso di errore di auth

rimosso commento di test

Fix riferimenti repo in release drafter e README per merge
per:
#45 (comment)
#45 (comment)

fix for permission in action
…effettuare tutte le request API allo stesso momento.
@virtualdj virtualdj added the major New major version label Nov 14, 2024
@virtualdj virtualdj self-assigned this Nov 14, 2024
@virtualdj virtualdj merged commit bc759c6 into master Nov 14, 2024
2 checks passed
@virtualdj virtualdj deleted the new-ver-1 branch November 14, 2024 20:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
major New major version
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants