Closed edaniszewski closed 6 years ago
this was fixed in the PR linked above
edaniszewski ~ ➜ curl -H "Content-Type: application/json" -X POST -d '{"action": "color", "raw": "abcdefgh"}' localhost:5000/synse/2.0/write/rack-1/vec/f52d29fecf05a195af13f14c7306cfed
[
{
"context":{
"action":"color",
"raw":[
"abcdefgh"
]
},
"transaction":"ba679hj9r54001s33g00"
}
]
edaniszewski ~ ➜ curllocalhost:5000/synse/2.0/transaction/ba679hj9r54001s33g00
{
"id":"ba679hj9r54001s33g00",
"context":{
"action":"color",
"raw":[
"abcdefgh"
]
},
"state":"error",
"status":"done",
"created":"2018-02-20T19:19:34.491248281Z",
"updated":"2018-02-20T19:19:34.787202735Z",
"message":"encoding\/hex: invalid byte: U+0067 'g'"
https://github.com/vapor-ware/synse-emulator-plugin/blob/master/devices/led.go#L59
it currently just sets whatever value it is given, even if the color isn't valid HEX. Will want to add some validation here so it more accurately emulates a real device.