Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] "TypeError: option values must be strings" when writing apiversion to config #98

Closed
DavidSchmidt00 opened this issue Jan 29, 2021 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@DavidSchmidt00
Copy link

DavidSchmidt00 commented Jan 29, 2021

Describe the bug

When trying to setup pylips with an old PhilipsTV (model 42PFL6097K/12 using apiversion 1) it throws a TypeError, because in line 156 it tries to write an integer to the config.

Console output

python pylips.py --host 192.168.178.24

Checking API version and port...
Trying http://192.168.178.24:1925/6/system
Trying http://192.168.178.24:1925/5/system
Connection refused
Trying http://192.168.178.24:1925/1/system
Could not find a valid API version! Pylips will try to use ' 1 '
Traceback (most recent call last):
  File "pylips.py", line 477, in <module>
    pylips = Pylips(args.config)
  File "pylips.py", line 83, in __init__
    if self.find_api_version(self.verbose):
  File "pylips.py", line 156, in find_api_version
    self.config["TV"]["apiv"] = api_version
  File "C:\Users\davod\AppData\Local\Programs\Python\Python38\lib\configparser.py", line 1258, in __setitem__
    self._parser._validate_value_types(option=key, value=value)
  File "C:\Users\davod\AppData\Local\Programs\Python\Python38\lib\configparser.py", line 1185, in _validate_value_types
    raise TypeError("option values must be strings")
TypeError: option values must be strings

How to fix
Change line 156 to:
self.config["TV"]["apiv"] = str(api_version)

@DavidSchmidt00 DavidSchmidt00 added the bug Something isn't working label Jan 29, 2021
@eslavnov
Copy link
Owner

Thanks @DavidSchmidt00!

Wow, this is embarrassing - I guess I've been spending too much time with JS lately... Fixed now, sorry about that!

@DavidSchmidt00
Copy link
Author

Thanks :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants