hardware: Fix 422 response, add `state_ok`
Cherry picked hardware changes from !830
- Calling set property or execute function with a non-valid payload (i.e. int instead of string) on a hardware device will now return the correct
ValidationError
response with amessages
dict. Before this had mistakenly stringified the dict response into anerror
. Need to check if this has broken anything. I.e. response was{"error": '{"velocity": ["Not a valid number."]'}
, and is now{"messages": {"velocity": ["Not a valid number."]}
-
state_ok
is dynamically added to hardwareproperties
this allows the UI to know if a hardware object isok
without having to iterate through the states on the client