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

Fix NaN device state #1394

Merged
merged 2 commits into from
Jan 3, 2022
Merged

Conversation

atrovato
Copy link
Contributor

@atrovato atrovato commented Dec 4, 2021

Pull Request check-list

To ensure your Pull Request can be accepted as fast as possible, make sure to review and check all of these items:

  • If your changes affects code, did your write the tests?
  • Are tests passing? (npm test on both front/server)
  • Is the linter passing? (npm run eslint on both front/server)
  • Did you run prettier? (npm run prettier on both front/server)
  • [ ] If you are adding a new features/services, did you run integration comparator? (npm run compare-translations on front)
  • Did you test this pull request in real life? With real devices? If this development is a big feature or a new service, we recommend that you provide a Docker image to the community for testing before merging.
  • [ ] If your changes modify the API (REST or Node.js), did you modify the API documentation? (Documentation is based on comments in code)
  • [ ] If you are adding a new features/services which needs explanation, did you modify the user documentation? See the GitHub repo and the website.
  • [ ] Did you add fake requests data for the demo mode (front/src/config/demo.js) so that the demo website is working without a backend? (if needed) See https://demo.gladysassistant.com.

NOTE: these things are not required to open a PR and can be done afterwards / while the PR is open.

Description of change

Avoid NaN on device state number value.

Fixes: #1392

@atrovato
Copy link
Contributor Author

atrovato commented Dec 4, 2021

Tested with values in DB, those are well removed on startup.

@codecov
Copy link

codecov bot commented Dec 4, 2021

Codecov Report

Merging #1394 (357498b) into master (f757f99) will decrease coverage by 0.06%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1394      +/-   ##
==========================================
- Coverage   96.61%   96.54%   -0.07%     
==========================================
  Files         613      613              
  Lines        8735     8738       +3     
==========================================
- Hits         8439     8436       -3     
- Misses        296      302       +6     
Impacted Files Coverage Δ
...rver/services/xiaomi/lib/event/xiaomi.onMessage.js 100.00% <ø> (ø)
server/services/zigbee2mqtt/utils/convertValue.js 100.00% <ø> (ø)
server/lib/device/device.saveState.js 100.00% <100.00%> (ø)
server/utils/childProcess.js 66.66% <0.00%> (-33.34%) ⬇️
server/utils/functionsWrapper.js 71.42% <0.00%> (-28.58%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a0b8831...357498b. Read the comment docs.

Copy link
Contributor

@Pierre-Gilles Pierre-Gilles left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! Just a comment on the Tasmota integration to be sure that we send a Number and not a string

server/lib/device/device.saveState.js Show resolved Hide resolved
@atrovato
Copy link
Contributor Author

atrovato commented Dec 8, 2021

I think we have a random test

  1) gateway
       gateway.backup
         should backup gladys:
     SequelizeDatabaseError: SQLITE_ERROR: cannot start a transaction within a transaction
      at Query.formatError (node_modules/sequelize/lib/dialects/sqlite/query.js:415:16)
      at Query._handleQueryResponse (node_modules/sequelize/lib/dialects/sqlite/query.js:72:18)
      at Statement.afterExecute (node_modules/sequelize/lib/dialects/sqlite/query.js:246:27)

That's not the 1st I get it.

@Pierre-Gilles
Copy link
Contributor

I often have this one too, but I can't understand which query could be running at the same time 🤷‍♂️

In SQLite you can't run two transactions at the same time (very annoying aha)

@Pierre-Gilles Pierre-Gilles merged commit 4d27c4a into GladysAssistant:master Jan 3, 2022
@relativeci
Copy link

relativeci bot commented Jan 3, 2022

Job #173: Bundle Size — 6.67MB (0%).

4d27c4a vs a0b8831

No changes


View Job #173 report on app.relative-ci.com

atrovato pushed a commit to atrovato/Gladys that referenced this pull request Jun 20, 2022
author POCHET Romuald <pochet.romuald@gmail.com> 1635496602 +0200
committer POCHET Romuald <pochet.romuald@gmail.com> 1645793440 +0100

parent b782865
author POCHET Romuald <pochet.romuald@gmail.com> 1635496602 +0200
committer POCHET Romuald <pochet.romuald@gmail.com> 1645793419 +0100

parent b782865
author POCHET Romuald <pochet.romuald@gmail.com> 1635496602 +0200
committer POCHET Romuald <pochet.romuald@gmail.com> 1645793401 +0100

parent b782865
author POCHET Romuald <pochet.romuald@gmail.com> 1635496602 +0200
committer POCHET Romuald <pochet.romuald@gmail.com> 1645793352 +0100

parent b782865
author POCHET Romuald <pochet.romuald@gmail.com> 1635496602 +0200
committer POCHET Romuald <pochet.romuald@gmail.com> 1645793338 +0100

parent b782865
author POCHET Romuald <pochet.romuald@gmail.com> 1635496602 +0200
committer POCHET Romuald <pochet.romuald@gmail.com> 1645793321 +0100

parent b782865
author POCHET Romuald <pochet.romuald@gmail.com> 1635496602 +0200
committer POCHET Romuald <pochet.romuald@gmail.com> 1645793308 +0100

parent b782865
author POCHET Romuald <pochet.romuald@gmail.com> 1635496602 +0200
committer POCHET Romuald <pochet.romuald@gmail.com> 1645793277 +0100

parent b782865
author POCHET Romuald <pochet.romuald@gmail.com> 1635496602 +0200
committer POCHET Romuald <pochet.romuald@gmail.com> 1645792967 +0100

parent b782865
author POCHET Romuald <pochet.romuald@gmail.com> 1635496602 +0200
committer POCHET Romuald <pochet.romuald@gmail.com> 1645792945 +0100

parent b782865
author POCHET Romuald <pochet.romuald@gmail.com> 1635496602 +0200
committer POCHET Romuald <pochet.romuald@gmail.com> 1645792308 +0100

parent b782865
author POCHET Romuald <pochet.romuald@gmail.com> 1635496602 +0200
committer POCHET Romuald <pochet.romuald@gmail.com> 1645792273 +0100

parent b782865
author POCHET Romuald <pochet.romuald@gmail.com> 1635496602 +0200
committer POCHET Romuald <pochet.romuald@gmail.com> 1645792256 +0100

parent b782865
author POCHET Romuald <pochet.romuald@gmail.com> 1635496602 +0200
committer POCHET Romuald <pochet.romuald@gmail.com> 1645791714 +0100

parent b782865
author POCHET Romuald <pochet.romuald@gmail.com> 1635496602 +0200
committer POCHET Romuald <pochet.romuald@gmail.com> 1645791690 +0100

Inital commit

Signed-off-by: POCHET Romuald <pochet.romuald@gmail.com>

Initail commit

Add scheduled jobs in task page

Add compare regexp

Initial commit

Add scheduled jobs in task page

Initial commit

PR

Initial commit

PR

Remove OZW

Missing labels

Check calendar event in scene action

Prettier

Catch bluetooth init error

Service folder

Remove OZW

Update Dockerfile.buildx

Update Dockerfile.buildx

Update Dockerfile.buildx

Update Dockerfile.buildx

Update Dockerfile.buildx

Update Dockerfile.buildx

Update Dockerfile.buildx

Disable bluetooth

Empty name if no summary for event

Move scheduler to scene manager

BUG:  Error serialization of WEBSOCKET_MESSAGE_TYPES.ZWAVE.NODE_READY

Unit tests

Prettier

Missing Bundle

Use regular require

Initial commit

Tests

Integration cover

Review configuration

BUG: Error serialization of event WEBSOCKET_MESSAGE_TYPES.ZWAVE.NODE_READY

Update scene.addScene.js

Remove overkiz

Update zwave.test.js

Update scene.addScene.js

Update index.js

Tests

Update index.test.js

Tests

Tests

Delete overkiz.jpg

Clean up

Clean up

Delete gladys-services/zwave/logs directory

Clean up

Upgrade zwave-js

Rename service folder

Clean up

Tests

Create zwave-js-pr.yml

Update index.js

Add CO sensor feature (GladysAssistant#1384)

* Add CO feature

* Add binary graphic

Add 44 (Scene Actuator Configuration v0) in config parameters

Upgrade ZwaveJS library

Delete zwave-js-pr.yml

Move service folder to tmp

Inital commit

Signed-off-by: POCHET Romuald <pochet.romuald@gmail.com>

Initail commit

Add compare regexp

Add scheduled jobs in task page

Initial commit

Initial commit

PR

Missing labels

Check calendar event in scene action

Prettier

Catch bluetooth init error

Update Dockerfile.buildx

Update Dockerfile.buildx

Disable bluetooth

Empty name if no summary for event

Unit tests

Missing Bundle

Initial commit

Tests

Integration cover

Remove overkiz

Tests

Delete overkiz.jpg

Clean up

Clean up

Delete gladys-services/zwave/logs directory

Clean up

Create zwave-js-pr.yml

Update index.js

Add CO sensor feature (GladysAssistant#1384)

* Add CO feature

* Add binary graphic

Add 44 (Scene Actuator Configuration v0) in config parameters

Delete zwave-js-pr.yml

Move service folder to tmp

Initail commit

Add scheduled jobs in task page

Add compare regexp

Initial commit

Add scheduled jobs in task page

Initial commit

PR

Initial commit

PR

Remove OZW

Missing labels

Check calendar event in scene action

Prettier

Catch bluetooth init error

Remove OZW

Update Dockerfile.buildx

Update Dockerfile.buildx

Update Dockerfile.buildx

Disable bluetooth

Empty name if no summary for event

Move scheduler to scene manager

Unit tests

Prettier

Missing Bundle

Use regular require

Initial commit

Tests

Integration cover

Review configuration

BUG: Error serialization of event WEBSOCKET_MESSAGE_TYPES.ZWAVE.NODE_READY

Update scene.addScene.js

Remove overkiz

Update scene.addScene.js

Update index.js

Update index.test.js

Tests

Delete overkiz.jpg

Clean up

Clean up

Delete gladys-services/zwave/logs directory

Clean up

Rename service folder

Clean up

Tests

Create zwave-js-pr.yml

Update index.js

Add CO sensor feature (GladysAssistant#1384)

* Add CO feature

* Add binary graphic

Add 44 (Scene Actuator Configuration v0) in config parameters

Delete zwave-js-pr.yml

Move service folder to tmp

Inital commit

Signed-off-by: POCHET Romuald <pochet.romuald@gmail.com>

Initail commit

Add scheduled jobs in task page

Add compare regexp

Initial commit

Add scheduled jobs in task page

Initial commit

PR

Initial commit

PR

Remove OZW

Remove openzwave build

Missing labels

Check calendar event in scene action

Prettier

Catch bluetooth init error

Remove OZW

Remove OZW

Remove OZW

Remove OZW

Remove OZW

Update Dockerfile.buildx

Update Dockerfile.buildx

Update Dockerfile.buildx

Disable bluetooth

Empty name if no summary for event

Move scheduler to scene manager

BUG:  Error serialization of WEBSOCKET_MESSAGE_TYPES.ZWAVE.NODE_READY

Unit tests

Prettier

Missing Bundle

Initial commit

Tests

Integration cover

Review configuration

Update scene.addScene.js

Remove overkiz

Update scene.addScene.js

Update index.js

Update index.test.js

Tests

Delete overkiz.jpg

Clean up

Clean up

Delete gladys-services/zwave/logs directory

Clean up

Rename service folder

Clean up

Tests

Create zwave-js-pr.yml

Update index.js

Fix & clean NaN device state (GladysAssistant#1394)

Co-authored-by: Pierre-Gilles Leymarie <pierregilles.leymarie@gmail.com>

Change 2021 to 2022 in README & LICENSE

Add new television category/features (GladysAssistant#1365)

Add missing units on switch device (GladysAssistant#1382)

Co-authored-by: Pierre-Gilles Leymarie <pierregilles.leymarie@gmail.com>

Add icon to vibration binary (GladysAssistant#1386)

Co-authored-by: Pierre-Gilles Leymarie <pierregilles.leymarie@gmail.com>

Add 44 (Scene Actuator Configuration v0) in config parameters

Add 44 (Scene Actuator Configuration v0) in config parameters

Delete zwave-js-pr.yml

Move service folder to tmp
atrovato pushed a commit to atrovato/Gladys that referenced this pull request Jun 20, 2022
author POCHET Romuald <pochet.romuald@gmail.com> 1635496602 +0200
committer POCHET Romuald <pochet.romuald@gmail.com> 1645793440 +0100

parent b782865
author POCHET Romuald <pochet.romuald@gmail.com> 1635496602 +0200
committer POCHET Romuald <pochet.romuald@gmail.com> 1645793419 +0100

parent b782865
author POCHET Romuald <pochet.romuald@gmail.com> 1635496602 +0200
committer POCHET Romuald <pochet.romuald@gmail.com> 1645793401 +0100

parent b782865
author POCHET Romuald <pochet.romuald@gmail.com> 1635496602 +0200
committer POCHET Romuald <pochet.romuald@gmail.com> 1645793352 +0100

parent b782865
author POCHET Romuald <pochet.romuald@gmail.com> 1635496602 +0200
committer POCHET Romuald <pochet.romuald@gmail.com> 1645793338 +0100

parent b782865
author POCHET Romuald <pochet.romuald@gmail.com> 1635496602 +0200
committer POCHET Romuald <pochet.romuald@gmail.com> 1645793321 +0100

parent b782865
author POCHET Romuald <pochet.romuald@gmail.com> 1635496602 +0200
committer POCHET Romuald <pochet.romuald@gmail.com> 1645793308 +0100

parent b782865
author POCHET Romuald <pochet.romuald@gmail.com> 1635496602 +0200
committer POCHET Romuald <pochet.romuald@gmail.com> 1645793277 +0100

parent b782865
author POCHET Romuald <pochet.romuald@gmail.com> 1635496602 +0200
committer POCHET Romuald <pochet.romuald@gmail.com> 1645792967 +0100

parent b782865
author POCHET Romuald <pochet.romuald@gmail.com> 1635496602 +0200
committer POCHET Romuald <pochet.romuald@gmail.com> 1645792945 +0100

parent b782865
author POCHET Romuald <pochet.romuald@gmail.com> 1635496602 +0200
committer POCHET Romuald <pochet.romuald@gmail.com> 1645792308 +0100

parent b782865
author POCHET Romuald <pochet.romuald@gmail.com> 1635496602 +0200
committer POCHET Romuald <pochet.romuald@gmail.com> 1645792273 +0100

parent b782865
author POCHET Romuald <pochet.romuald@gmail.com> 1635496602 +0200
committer POCHET Romuald <pochet.romuald@gmail.com> 1645792256 +0100

parent b782865
author POCHET Romuald <pochet.romuald@gmail.com> 1635496602 +0200
committer POCHET Romuald <pochet.romuald@gmail.com> 1645791714 +0100

parent b782865
author POCHET Romuald <pochet.romuald@gmail.com> 1635496602 +0200
committer POCHET Romuald <pochet.romuald@gmail.com> 1645791690 +0100

Inital commit

Signed-off-by: POCHET Romuald <pochet.romuald@gmail.com>

Initail commit

Add scheduled jobs in task page

Add compare regexp

Initial commit

Add scheduled jobs in task page

Initial commit

PR

Initial commit

PR

Remove OZW

Missing labels

Check calendar event in scene action

Prettier

Catch bluetooth init error

Service folder

Remove OZW

Update Dockerfile.buildx

Update Dockerfile.buildx

Update Dockerfile.buildx

Update Dockerfile.buildx

Update Dockerfile.buildx

Update Dockerfile.buildx

Update Dockerfile.buildx

Disable bluetooth

Empty name if no summary for event

Move scheduler to scene manager

BUG:  Error serialization of WEBSOCKET_MESSAGE_TYPES.ZWAVE.NODE_READY

Unit tests

Prettier

Missing Bundle

Use regular require

Initial commit

Tests

Integration cover

Review configuration

BUG: Error serialization of event WEBSOCKET_MESSAGE_TYPES.ZWAVE.NODE_READY

Update scene.addScene.js

Remove overkiz

Update zwave.test.js

Update scene.addScene.js

Update index.js

Tests

Update index.test.js

Tests

Tests

Delete overkiz.jpg

Clean up

Clean up

Delete gladys-services/zwave/logs directory

Clean up

Upgrade zwave-js

Rename service folder

Clean up

Tests

Create zwave-js-pr.yml

Update index.js

Add CO sensor feature (GladysAssistant#1384)

* Add CO feature

* Add binary graphic

Add 44 (Scene Actuator Configuration v0) in config parameters

Upgrade ZwaveJS library

Delete zwave-js-pr.yml

Move service folder to tmp

Inital commit

Signed-off-by: POCHET Romuald <pochet.romuald@gmail.com>

Initail commit

Add compare regexp

Add scheduled jobs in task page

Initial commit

Initial commit

PR

Missing labels

Check calendar event in scene action

Prettier

Catch bluetooth init error

Update Dockerfile.buildx

Update Dockerfile.buildx

Disable bluetooth

Empty name if no summary for event

Unit tests

Missing Bundle

Initial commit

Tests

Integration cover

Remove overkiz

Tests

Delete overkiz.jpg

Clean up

Clean up

Delete gladys-services/zwave/logs directory

Clean up

Create zwave-js-pr.yml

Update index.js

Add CO sensor feature (GladysAssistant#1384)

* Add CO feature

* Add binary graphic

Add 44 (Scene Actuator Configuration v0) in config parameters

Delete zwave-js-pr.yml

Move service folder to tmp

Initail commit

Add scheduled jobs in task page

Add compare regexp

Initial commit

Add scheduled jobs in task page

Initial commit

PR

Initial commit

PR

Remove OZW

Missing labels

Check calendar event in scene action

Prettier

Catch bluetooth init error

Remove OZW

Update Dockerfile.buildx

Update Dockerfile.buildx

Update Dockerfile.buildx

Disable bluetooth

Empty name if no summary for event

Move scheduler to scene manager

Unit tests

Prettier

Missing Bundle

Use regular require

Initial commit

Tests

Integration cover

Review configuration

BUG: Error serialization of event WEBSOCKET_MESSAGE_TYPES.ZWAVE.NODE_READY

Update scene.addScene.js

Remove overkiz

Update scene.addScene.js

Update index.js

Update index.test.js

Tests

Delete overkiz.jpg

Clean up

Clean up

Delete gladys-services/zwave/logs directory

Clean up

Rename service folder

Clean up

Tests

Create zwave-js-pr.yml

Update index.js

Add CO sensor feature (GladysAssistant#1384)

* Add CO feature

* Add binary graphic

Add 44 (Scene Actuator Configuration v0) in config parameters

Delete zwave-js-pr.yml

Move service folder to tmp

Inital commit

Signed-off-by: POCHET Romuald <pochet.romuald@gmail.com>

Initail commit

Add scheduled jobs in task page

Add compare regexp

Initial commit

Add scheduled jobs in task page

Initial commit

PR

Initial commit

PR

Remove OZW

Remove openzwave build

Missing labels

Check calendar event in scene action

Prettier

Catch bluetooth init error

Remove OZW

Remove OZW

Remove OZW

Remove OZW

Remove OZW

Update Dockerfile.buildx

Update Dockerfile.buildx

Update Dockerfile.buildx

Disable bluetooth

Empty name if no summary for event

Move scheduler to scene manager

BUG:  Error serialization of WEBSOCKET_MESSAGE_TYPES.ZWAVE.NODE_READY

Unit tests

Prettier

Missing Bundle

Initial commit

Tests

Integration cover

Review configuration

Update scene.addScene.js

Remove overkiz

Update scene.addScene.js

Update index.js

Update index.test.js

Tests

Delete overkiz.jpg

Clean up

Clean up

Delete gladys-services/zwave/logs directory

Clean up

Rename service folder

Clean up

Tests

Create zwave-js-pr.yml

Update index.js

Fix & clean NaN device state (GladysAssistant#1394)

Co-authored-by: Pierre-Gilles Leymarie <pierregilles.leymarie@gmail.com>

Change 2021 to 2022 in README & LICENSE

Add new television category/features (GladysAssistant#1365)

Add missing units on switch device (GladysAssistant#1382)

Co-authored-by: Pierre-Gilles Leymarie <pierregilles.leymarie@gmail.com>

Add icon to vibration binary (GladysAssistant#1386)

Co-authored-by: Pierre-Gilles Leymarie <pierregilles.leymarie@gmail.com>

Add 44 (Scene Actuator Configuration v0) in config parameters

Add 44 (Scene Actuator Configuration v0) in config parameters

Delete zwave-js-pr.yml

Move service folder to tmp
@atrovato atrovato deleted the device-state-nan branch October 31, 2022 15:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Zigbee2mqtt integration insert "NaN" values in device_feature_state table, it shouldn't be possible
2 participants