Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## [Unreleased]

## [0.13.1] - 2020-05-29
### Changed
- Support new zeroconf version

## [0.13.0] - 2020-05-04
### Changed
- Invalid POST requests to action resources now generate an error status.
Expand Down Expand Up @@ -45,7 +49,8 @@
### Changed
- Property, Action, and Event description now use `links` rather than `href`. - [Spec PR](https://github.com/mozilla-iot/wot/pull/119)

[Unreleased]: https://github.com/mozilla-iot/webthing-python/compare/v0.13.0...HEAD
[Unreleased]: https://github.com/mozilla-iot/webthing-python/compare/v0.13.1...HEAD
[0.13.0]: https://github.com/mozilla-iot/webthing-python/compare/v0.13.0...v0.13.1
[0.13.0]: https://github.com/mozilla-iot/webthing-python/compare/v0.12.2...v0.13.0
[0.12.2]: https://github.com/mozilla-iot/webthing-python/compare/v0.12.1...v0.12.2
[0.12.1]: https://github.com/mozilla-iot/webthing-python/compare/v0.12.0...v0.12.1
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ pyee>=7.0.0
tornado==5.1.*; python_version == '2.7'
tornado>=6.0.0; python_version >= '3.5'
zeroconf==0.19.*; python_version == '2.7'
zeroconf>=0.26.0; python_version >= '3.5'
zeroconf>=0.27.0; python_version >= '3.5'
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@
requirements.extend([
'jsonschema>=3.2.0',
'tornado>=6.0.0',
'zeroconf>=0.26.0',
'zeroconf>=0.27.0',
])

setup(
name='webthing',
version='0.13.0',
version='0.13.1',
description='HTTP Web Thing implementation',
long_description=long_description,
url='https://github.com/mozilla-iot/webthing-python',
Expand Down
20 changes: 15 additions & 5 deletions webthing/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from zeroconf import ServiceInfo, Zeroconf
import json
import socket
import sys
import tornado.concurrent
import tornado.gen
import tornado.httpserver
Expand Down Expand Up @@ -853,15 +854,24 @@ def __init__(self, things, port=80, hostname=None, ssl_options=None,

def start(self):
"""Start listening for incoming connections."""
self.service_info = ServiceInfo(
args = [
'_webthing._tcp.local.',
'{}._webthing._tcp.local.'.format(self.name),
address=socket.inet_aton(get_ip()),
port=self.port,
properties={
]
kwargs = {
'port': self.port,
'properties': {
'path': '/',
},
server='{}.local.'.format(socket.gethostname()))
'server': '{}.local.'.format(socket.gethostname()),
}

if sys.version_info.major == 3:
kwargs['addresses'] = [socket.inet_aton(get_ip())]
else:
kwargs['address'] = socket.inet_aton(get_ip())

self.service_info = ServiceInfo(*args, **kwargs)
self.zeroconf = Zeroconf()
self.zeroconf.register_service(self.service_info)

Expand Down