Blueforcer / awtrix3

Custom firmware for the Ulanzi Smart Pixel clock or self made awtrix. Getting started is easy as 1-2-3
https://blueforcer.github.io/awtrix3/
Other
1.26k stars 109 forks source link

[BUG] Power Control REST API Bool Payload #473

Closed berndb84 closed 8 months ago

berndb84 commented 8 months ago

Bug report

Describe the bug

I was trying to use the REST APIs. I made a mistake in the payload of the Power Control API with Boolean data and found this issue.

Additional information

To Reproduce

Steps to reproduce the behavior: Using the API: http://[IP]/api/power
With payload {"power": "true"} clock will switch on, but with {"power": "false"}it will not switch off. The response from the clock is always 200.

Expected behavior

The payload for JSON Booleans should always be without double quotes ("). The clock should not change the power mode on a wrong request. In addition it should response with eg. Bad Request (400).

Blueforcer commented 8 months ago

currently there is no single check on any API point.