DannyDeGaspari / Samsung-HVAC-buscontrol

Protocol description of the serial communication channel of Samsung airconditioners.
GNU General Public License v3.0
71 stars 17 forks source link

lib_hvac "invalid syntax" #7

Closed mat-the-w closed 1 month ago

mat-the-w commented 3 years ago

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

michelebergo commented 3 years ago

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

mat-the-w commented 3 years ago

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

guybridge commented 2 years ago

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