Commit Graph
28 Commits
Author SHA1 Message Date
Sulka HaroandGitHub 3a0629578e Refactor moment to be loaded from ctx (#7331)
* Experimental branch that replaces momentjs with dayjs in the client

* Revert unintentional change

* feat

* Turns out dayjs is a no-go, but this has some good restructuring so submitting that
2023-01-01 19:14:59 +02:00
Sulka HaroandGitHub 4ace12594e Move localisation to Crowdin (#6518)
* Update Crowdin configuration file

* Update Crowdin configuration file

* Add languages for pushing

* Update Crowdin configuration file

* Update source file en.json

* New translations en.json (Finnish)

* New translations en.json (Finnish)

* New translations en.json (Romanian)

* New translations en.json (Dutch)

* New translations en.json (Croatian)

* New translations en.json (Portuguese, Brazilian)

* New translations en.json (Chinese Traditional)

* New translations en.json (Chinese Simplified)

* New translations en.json (Turkish)

* New translations en.json (Swedish)

* New translations en.json (Slovenian)

* New translations en.json (Russian)

* New translations en.json (Polish)

* New translations en.json (Korean)

* New translations en.json (French)

* New translations en.json (Japanese)

* New translations en.json (Italian)

* New translations en.json (Hungarian)

* New translations en.json (Hebrew)

* New translations en.json (Greek)

* New translations en.json (German)

* New translations en.json (Danish)

* New translations en.json (Czech)

* New translations en.json (Bulgarian)

* New translations en.json (Spanish)

* New translations en.json (Norwegian Bokmal)

* New translations en.json (Chinese Traditional)

* New translations en.json (Chinese Simplified)

* Remove folders

* New translations en.json (Romanian)

* New translations en.json (Korean)

* New translations en.json (Croatian)

* New translations en.json (Portuguese, Brazilian)

* New translations en.json (Chinese Traditional)

* New translations en.json (Turkish)

* New translations en.json (Swedish)

* New translations en.json (Slovenian)

* New translations en.json (Russian)

* New translations en.json (Polish)

* New translations en.json (Dutch)

* New translations en.json (Japanese)

* New translations en.json (French)

* New translations en.json (Italian)

* New translations en.json (Hungarian)

* New translations en.json (Hebrew)

* New translations en.json (Finnish)

* New translations en.json (Greek)

* New translations en.json (German)

* New translations en.json (Danish)

* New translations en.json (Czech)

* New translations en.json (Bulgarian)

* New translations en.json (Norwegian Bokmal)

* New translations en.json (Romanian)

* New translations en.json (Korean)

* New translations en.json (Croatian)

* New translations en.json (Portuguese, Brazilian)

* New translations en.json (Turkish)

* New translations en.json (Swedish)

* New translations en.json (Slovenian)

* New translations en.json (Russian)

* New translations en.json (Polish)

* New translations en.json (Dutch)

* New translations en.json (Japanese)

* New translations en.json (French)

* New translations en.json (Italian)

* New translations en.json (Hungarian)

* New translations en.json (Hebrew)

* New translations en.json (Finnish)

* New translations en.json (Greek)

* New translations en.json (German)

* New translations en.json (Danish)

* New translations en.json (Czech)

* New translations en.json (Bulgarian)

* New translations en.json (Norwegian Bokmal)

* Update Crowdin configuration file

* New translations en.json (Spanish)

* New translations en.json (Chinese Simplified)

* New translations en.json (Chinese Traditional)

* New translations en.json (Italian)

* New translations en.json (Croatian)

* New translations en.json (Portuguese, Brazilian)

* New translations en.json (Turkish)

* New translations en.json (Swedish)

* New translations en.json (Slovenian)

* New translations en.json (Russian)

* New translations en.json (Polish)

* New translations en.json (Dutch)

* New translations en.json (Korean)

* New translations en.json (Japanese)

* New translations en.json (Hungarian)

* New translations en.json (Hebrew)

* New translations en.json (Finnish)

* New translations en.json (Greek)

* New translations en.json (German)

* New translations en.json (Danish)

* New translations en.json (Czech)

* New translations en.json (Bulgarian)

* New translations en.json (French)

* New translations en.json (Romanian)

* New translations en.json (Norwegian Bokmal)

* Loading all languages now works

* * Fix unit tests
* Have server load localizations

* Adding some more keys

* New Crowdin updates (#6531)

* New translations en.json (Finnish)

* New translations en.json (Norwegian Bokmal)

* New translations en.json (Finnish)

* New translations en.json (Japanese)

* New translations en.json (Portuguese, Brazilian)

* New translations en.json (Chinese Traditional)

* New translations en.json (Chinese Simplified)

* New translations en.json (Turkish)

* New translations en.json (Swedish)

* New translations en.json (Slovenian)

* New translations en.json (Russian)

* New translations en.json (Polish)

* New translations en.json (Dutch)

* New translations en.json (Korean)

* New translations en.json (Italian)

* New translations en.json (Norwegian Bokmal)

* New translations en.json (Hungarian)

* New translations en.json (Hebrew)

* New translations en.json (Greek)

* New translations en.json (German)

* New translations en.json (Danish)

* New translations en.json (Czech)

* New translations en.json (Bulgarian)

* New translations en.json (Spanish)

* New translations en.json (French)

* New translations en.json (Romanian)

* New translations en.json (Croatian)

* Update source file en.json

* New translations en.json (Norwegian Bokmal)

* New translations en.json (Norwegian Bokmal)

* Remove old translation status tool

* Update CONTRIBUTING
2020-11-17 14:17:17 +02:00
Sulka HaroandGitHub c153a965bc Merge pull request #5137 from inventor96/update-virtual-assistants-v2
Update virtual assistants v2
2019-12-06 12:18:26 +02:00
Willem FibbeandSulka Haro c6e763521c Fix falsely suspended timeago alarms (#5170)
* Fix continuous suspension of the timeago alerts

The default hearbeat-setting is 60 seconds, so the delta between two
timeago-checks will always be >15 seconds and the timeago-alarms will
always be suspended (that's what Papertrail also shows).

To fix this, make the delta-check heartbeat-setting-dependant and also simplify
the code by using just 1 variable.

* Add test that verifies the hibernation detection behaviour

The real-world test would be to actually wait for a couple of minutes (with 2 *
heartbeat of default settings) in the unit test, but this is not feasible, so
just modify the heartbeat-setting to a lower value.

I tested it by only running tests inside `tests/timeago.test.js` and by actually
deploying this code and testing the alarms with Pushover and reading the logs in
Papertrail.

Before this change, I saw a 'Hibernation detected' log every minute. After this
change, I didn't see it anymore, probably because the app wasn't actually
hibernated (yet).

* Take sulkaharo's feedback into account and differentiate
between client and server (by introducing it in sandbox.js).

On the client the behaviour is different from the server:

> On client, the issue is browsers stop the execution of JS if the window is not
> visible and the alarm is falsely triggered immediately when the execution is
> resumed, so we need to suspend the alarm for ~10 seconds after the execution has
> resumed to give the client time to update the data to prevent false alarms.

While on the server, the default heartbeat from 60s needs to be taken
into account to prevent the timeago alarm from falsely triggering.
So detect hibernation there if the last check was more than 2 heartbeats ago.

* Fix the tests by adding settings to the context,
which is now required by timeago.

Also, change the timeago test a bit so that it both succeeds
when testing in isolation as when testing it along with the other tests.
2019-11-10 21:07:01 +00:00
PieterGitandGitHub 36de82bffd Revert "fix/feat: Update Alexa integration and add Google Home support (#4980)" (#5131)
This reverts commit 30b88f6765.
2019-10-21 16:23:32 +02:00
CalebandPieterGit 30b88f6765 fix/feat: Update Alexa integration and add Google Home support (#4980)
* Copied work done by mdomox

* Updates and fixes to CONTRIBUTING.md

* Spacing unification

* One more fix for CONTRIBUTING.md

* Minor code formatting improvements

* One more time...

* Renamed Alexa stuff to virtAsst for generic-ness

* Corrected missed translate() text

* Updated googlehome plugin to mimic the alexa plugin

* Changed order of operations

* Fixed parameter referencing in googlehome

* Yet another CONTRIBUTING fix

* Removed extra google stuff

* Migrated standalone intents to MetricNow intent

* Simplified route handling

* Added logging

* Added forgotten path selector

* Separated instructions for adding virtual assistant support in a plugin

* A few typo fixes

* Improved logging

* Updated Google Home plugin instructions

* Attempt to trigger download of template file

* Small wording tweaks

* Updated Alexa plugin documentation

* Updated test files

* Re-added handler count tests so devs are prompted to write tests for new handlers

* Updated Alexa documentation

* Small typo fix

* Clarification

* Further clarifications and typos

* Added language info to Google Home plugin doc

* URL correction

* URL fix v2

* Wording clarification

* Ugh...

* Minor instruction fix

* Sub steps fix

* Fixed Alexa references in Google Home

* Added a couple steps for improved user experience

* One more forgotten step

* Updated pump reservoir handler to handle undefined values

* Updated titles and unknown-value responses

* Modified forecast responses to use translate()

* Updated tests

* Improved training phrases

* Wording improvements

* Google Home setup instruction corrections

* Corrected how metric selection is found
2019-10-21 14:09:49 +02:00
inventor96 0a48c1d81a Re-added handler count tests so devs are prompted to write tests for new handlers 2019-09-10 00:14:21 -06:00
inventor96 3563158aae Updated test files 2019-09-10 00:06:24 -06:00
inventor96 efa35c4616 Renamed Alexa stuff to virtAsst for generic-ness 2019-09-07 17:51:31 -06:00
Tanja Schmidt 1643b96fc2 alexa translations 2017-07-25 22:33:20 +02:00
Jason Calabrese eee2baa12e fix bug with null value for openaps.iob 2016-12-23 00:00:49 -08:00
Jason Calabrese 57510b106e add tests and clean up 2016-12-01 18:44:00 -08:00
Jason Calabrese 97844ea51c fix iob test for new rounding 2016-11-30 20:09:31 -08:00
Jason Calabrese 00b93d572d refactoring, add alexa tests 2016-11-12 12:55:21 -08:00
MilosKozak 6c5c517d6e iob translations 2016-10-24 13:30:31 +02:00
Jason Calabrese 3d7b813c03 fix/cleanup test 2016-05-21 20:50:14 -07:00
Jason Calabrese fcece77325 fix test data, to match real data 2016-05-16 22:00:15 -07:00
Jason Calabrese a1d2b206c4 added support for muli-rig environments where last devicestatus won't always be best; also support for AMA iob arrays 2016-03-30 19:25:23 -07:00
Mark Wilson 27a1b311fd Handle IOB format from MM Connect 2016-03-25 12:29:19 -07:00
Mark Wilson f5d5dfc86d Show IOB from devicestatus when available 2016-03-25 12:29:16 -07:00
Jason Calabrese 48fb534219 treatment.created_at -> mills; less new Date's and less .getTime()'s 2015-07-07 19:23:23 -07:00
Jason Calabrese fd585720b8 fix lots of little issues reported by codacy 2015-06-30 23:34:59 -07:00
Sulka Haro 6b92df90c5 Fixed IOB tests and a bug in the COB code from my changes. The COB test is still broken, probably as a result of the IOB call change I did, where COB was passing a date instead of profile, which must have caused miscalculation in IOB code. 2015-06-23 00:36:23 +03:00
Jason Calabrese 8625ec0c7d fix iob tests 2015-05-24 11:37:20 -07:00
Jason Calabrese a7f68f40ce workaround to a rounding issue that shows -0.00 iob 2015-03-22 20:31:22 -07:00
Jason Calabrese bf2bac6329 some cleanup suggested by @dduugg and some more IOB tests 2015-03-07 16:06:43 -08:00
Jason Calabrese 26786e681d fix iob test to expect new updated iob display value 2015-03-06 23:24:45 -08:00
Jason Calabrese 0aea8a7b26 very basic IOB test 2015-03-01 13:21:30 -08:00