UniversalDevicesInc-PG3 / udi-poly-notification

Polyglot v2 NodeServer for Notifications
MIT License
2 stars 1 forks source link

SET_SYS_SHORT Crash when sending command #37

Closed JavierRefuerzo closed 2 years ago

JavierRefuerzo commented 2 years ago

Node Server crashes when SET_SYS_SHORT is sent

i.e. http://192.168.1.160:8080/rest/nodes/n004_po_pushover/cmd/SET_SYS_SHORT/1/146 where 1 is the message id

2022-04-12 15:22:31,266 Command    udi_interface.interface ERROR    interface:_handleInput: _parseInput: failed po_pushover.runCmd(SET_SYS_SHORT) invalid literal for int() with base 10: 'Test Subject'
Traceback (most recent call last):
  File "/var/polyglot/.local/lib/python3.8/site-packages/udi_interface/interface.py", line 793, in _handleInput
    self.nodes_internal[item['address']].runCmd(item)
  File "/var/polyglot/.local/lib/python3.8/site-packages/udi_interface/node.py", line 155, in runCmd
    fun(self, command)
  File "/var/polyglot/pg3/ns/00:0d:b9:53:30:1c_4/nodes/Pushover.py", line 523, in cmd_set_sys_short
    val = int(command.get('value'))
ValueError: invalid literal for int() with base 10: 'Test Subject'
jimboca commented 2 years ago

Thanks, I assume "Test Subject" is message 1? Not sure why this is different than how I am using it, but will take a look.

JavierRefuerzo commented 2 years ago

Yes. My guess from the log is the NS expecting an int instead of string?

jimboca commented 2 years ago

Yes, I know what its expecting :) just have to debug why this happens for you since it works for me.

jimboca commented 2 years ago

Guess I had never tested setting sys short message, I just always run it with the "Send Sys Short With Params", Easy fix.