Fix zeroconf server builder
This commit is contained in:
parent
c2bfa04c35
commit
e9602f1215
|
@ -286,6 +286,16 @@ class ZeroconfServer(Closeable):
|
|||
else:
|
||||
logging.warning("Unknown action: {}".format(action))
|
||||
|
||||
class Builder(Session.Builder):
|
||||
listen_port: int = -1
|
||||
|
||||
def set_listen_port(self, listen_port: int):
|
||||
self.listen_port = listen_port
|
||||
return self
|
||||
|
||||
def create(self) -> ZeroconfServer:
|
||||
return ZeroconfServer(ZeroconfServer.Inner(self.device_type, self.device_name, self.device_id, self.preferred_locale, self.conf), self.listen_port)
|
||||
|
||||
class Inner:
|
||||
conf: typing.Final[Session.Configuration]
|
||||
device_name: typing.Final[str]
|
||||
|
|
Loading…
Reference in New Issue