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

Current zeroconf has error about adding string and float #17

Open
beached opened this issue Jul 1, 2020 · 2 comments
Open

Current zeroconf has error about adding string and float #17

beached opened this issue Jul 1, 2020 · 2 comments

Comments

@beached
Copy link

beached commented Jul 1, 2020

  File "/usr/local/Cellar/python/3.7.7/Frameworks/Python.framework/Versions/3.7/lib/python3.7/threading.py", line 926, in _bootstrap_inner
    self.run()
  File "/usr/local/Cellar/python/3.7.7/Frameworks/Python.framework/Versions/3.7/lib/python3.7/threading.py", line 870, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/local/lib/python3.7/site-packages/co2meter/server.py", line 316, in init_homekit_target
    start_homekit(mon, host=host, port=port, monitoring=False, handle_sigint=False)
  File "/usr/local/lib/python3.7/site-packages/co2meter/homekit.py", line 145, in start_homekit
    driver.start()
  File "/usr/local/lib/python3.7/site-packages/pyhap/accessory_driver.py", line 472, in start
    self.advertiser.register_service(self.mdns_service_info)
  File "/usr/local/lib/python3.7/site-packages/zeroconf/__init__.py", line 2385, in register_service
    self._broadcast_service(info)
  File "/usr/local/lib/python3.7/site-packages/zeroconf/__init__.py", line 2419, in _broadcast_service
    info.server,
  File "/usr/local/lib/python3.7/site-packages/zeroconf/__init__.py", line 652, in __init__
    DNSRecord.__init__(self, name, type_, class_, ttl)
  File "/usr/local/lib/python3.7/site-packages/zeroconf/__init__.py", line 457, in __init__
    self._expiration_time = self.get_expiration_time(100)
  File "/usr/local/lib/python3.7/site-packages/zeroconf/__init__.py", line 484, in get_expiration_time
    return self.created + (percent * self.ttl * 10)
TypeError: unsupported operand type(s) for +: 'float' and 'str'

Reverting zeroconf to 0.23 remediated this. The issue was on both mac and ubuntu(rasp pi)

@vfilimonov
Copy link
Owner

Thank you for reporting this! I will add a note about it then.

@vfilimonov
Copy link
Owner

I believe that updating to a newer pyhap should solve it (and would be a proper fix), but apparently some interfaces were changed after version 1.1.5, and unfortunately I don't have capacity at the moment to look into that.

But PRs are always welcome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants