Samsung-HVAC-buscontrol icon indicating copy to clipboard operation
Samsung-HVAC-buscontrol copied to clipboard

lib_hvac "invalid syntax"

Open mat-the-w opened this issue 3 years ago • 3 comments

https://github.com/DannyDeGaspari/Samsung-HVAC-buscontrol/blob/ad46848be445b3704913fa70d358eeb3783c084a/lib_hvac.py#L48

Love your work Danny, I would have never gotten this far without you.

I have serial_dump working, and the output looks reasonable.

When I try to call ac_status.py I get the following error:


pi@raspberrypi:~ $ python ac_status.py 
Traceback (most recent call last):
  File "ac_status.py", line 5, in <module>
    import lib_hvac
  File "/home/pi/lib_hvac.py", line 52
    print('%2.2X' % i, end = '  ' )
                           ^
SyntaxError: invalid syntax

I have tried uncommenting lines 51 & 55, but I must confess, I have no idea what is happening here. Can you point me in the right direction?

Thanks,

Matt

mat-the-w avatar May 24 '21 01:05 mat-the-w

https://github.com/DannyDeGaspari/Samsung-HVAC-buscontrol/blob/ad46848be445b3704913fa70d358eeb3783c084a/lib_hvac.py#L48

Love your work Danny, I would have never gotten this far without you.

I have serial_dump working, and the output looks reasonable.

When I try to call ac_status.py I get the following error:


pi@raspberrypi:~ $ python ac_status.py 
Traceback (most recent call last):
  File "ac_status.py", line 5, in <module>
    import lib_hvac
  File "/home/pi/lib_hvac.py", line 52
    print('%2.2X' % i, end = '  ' )
                           ^
SyntaxError: invalid syntax

I have tried uncommenting lines 51 & 55, but I must confess, I have no idea what is happening here. Can you point me in the right direction?

Thanks,

Matt

Hi Matt, which python version are you using?

BR, Mich

michelebergo avatar May 24 '21 17:05 michelebergo

Hi Matt, which python version are you using?

Hi Mich,

Using Python 2.7.16

If I try python 3.7.3 I don't get a syntax error, but I also don't get any output, and serial_dump.py also doesn't work (no error, no output)

Thanks, Matt

mat-the-w avatar May 25 '21 11:05 mat-the-w

I found I had to change all the print statements to include parenthesis to make it work in python 3.

guybridge avatar Jun 13 '22 10:06 guybridge