-
-
Notifications
You must be signed in to change notification settings - Fork 33
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
v2.1.0: Token read/write // refact code #382
Conversation
Your codes rules are really weird ;) up to you to finish ;) |
I will see that add auto-refresh token |
what is the right way to test your code adjustments? If I make the adjustments manually and restart MM, then nothing is displayed anymore. If I remove your adjustments and restart MM, then everything works fine. Is it not enough if I just adjust helper.js, do I need additional commands like |
Right, I rewrite many thing... Now result is on first start: [2024-06-22 10:01:23.027] [LOG] Connecting socket for: netatmo
[2024-06-22 10:01:23.028] [LOG] Netatmo helper started ...
[2024-06-22 10:01:23.028] [LOG] Sockets connected & modules started ...
[2024-06-22 10:01:23.138] [LOG] Launching application.
[2024-06-22 10:01:24.173] [LOG] Netatmo: using refresh_token from config
[2024-06-22 10:01:24.173] [LOG] Netatmo: Initialized
[2024-06-22 10:01:24.498] [LOG] Netatmo: Authenticated
[2024-06-22 10:01:24.498] [LOG] Netatmo: token.json was written successfully
[2024-06-22 10:01:24.501] [LOG] Netatmo: New Token Expire Saturday, June 22, 2024 1:01 PM on restart: [2024-06-22 10:03:01.312] [LOG] Connecting socket for: netatmo
[2024-06-22 10:03:01.312] [LOG] Netatmo helper started ...
[2024-06-22 10:03:01.312] [LOG] Sockets connected & modules started ...
[2024-06-22 10:03:01.419] [LOG] Launching application.
[2024-06-22 10:03:02.467] [LOG] Netatmo: using token.json file
[2024-06-22 10:03:02.467] [LOG] Netatmo: Initialized
[2024-06-22 10:03:02.792] [LOG] Netatmo: Authenticated
[2024-06-22 10:03:02.793] [LOG] Netatmo: token.json was written successfully
[2024-06-22 10:03:02.797] [LOG] Netatmo: New Token Expire Saturday, June 22, 2024 1:03 PM I will force refresh token and see what happen :=) [2024-06-22 10:07:04.238] [LOG] Netatmo: using token.json file
[2024-06-22 10:07:04.238] [LOG] Netatmo: Initialized
[2024-06-22 10:07:04.557] [LOG] Netatmo: Authenticated
[2024-06-22 10:07:04.558] [LOG] Netatmo: token.json was written successfully
[2024-06-22 10:07:04.561] [LOG] Netatmo: New Token Expire Saturday, June 22, 2024 1:07 PM
[2024-06-22 10:07:19.570] [LOG] Netatmo: Refresh Token
[2024-06-22 10:07:19.676] [LOG] Netatmo: token.json was written successfully
[2024-06-22 10:07:19.676] [LOG] Netatmo: TOKEN Updated
[2024-06-22 10:07:19.677] [LOG] Netatmo: New Token Expire Saturday, June 22, 2024 1:07 PM
[2024-06-22 10:07:34.679] [LOG] Netatmo: Refresh Token
[2024-06-22 10:07:34.781] [LOG] Netatmo: token.json was written successfully
[2024-06-22 10:07:34.782] [LOG] Netatmo: TOKEN Updated
[2024-06-22 10:07:34.783] [LOG] Netatmo: New Token Expire Saturday, June 22, 2024 1:07 PM For me, It's works :) |
(Note: I really don't agree with your rules of the test workflows suite... thx to review your rules) I suggest to review your rules:
|
@bugsounet if you want, i can share you a temporary API from my NETATMO, just send me a Message and i will send you all required codes. at 11:15 i have cloned your fork and it works. it works after reboot the RPI, it works after |
@Lusbueb69 You can try it by your self ;) try this in git fetch origin pull/382/head:bugsounetTest
git checkout -f bugsounetTest If any next restart must use token file To reverse to main git checkout -f main Naturally don't forget to restart MM² :) |
i have choose an other way (because i'm a dummy-user):
i'm so happy, everything works fine, still after a RPI reboot or a |
* delete helper.test.js / .env.template : can't works now with new netatmo API Rules * add token.json in .gitignore * update README.md * minor fix in helper.js * cleaning package.json * update validation rules * fix renovate.json
@CFenner: I'm going to stop there, it remains validate:md to do |
Really appreciate this PR, thank!
I use |
This reverts commit 0f3ed1b.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
@all-contributors please add @bugsounet for code, bug, review |
I've put up a pull request to add @bugsounet! 🎉 |
Change Log:
netatmo.js:
self
... usethis
start()
send now config tohelper.js
and use it (without self!)helper.js:
this
token.json
file when Authenticate done (with new credentials)refresh_token
of config for autenticatetoken.json
file for authenticatethis.clientId
,this.clientSecret
,this.refreshToken
Delete Deps:
@ungap/url-search-params
: not needed with node > 18Add eslint rules:
eslint.config.js
from my common modulesAdd Deps:
@eslint/js
@stylistic/eslint-plugin
package.json
validate:js
scriptfix:js
scriptlint (with eslint.config.js)
workflows:
helper.test.js
/.env.template
: can't works now with new netatmo API RulesAdd
token.json
to.gitignore
Update README.md
cd netatmo && npm ci --production --ignore-scripts
--> is now not neededmockData: true
: ok