mdns_beacon package¶
Subpackages¶
Submodules¶
mdns_beacon.base module¶
Base mDNS Beacon module.
- class mdns_beacon.base.BaseBeacon(ip_version: Optional[zeroconf._utils.net.IPVersion] = None)[source]¶
Bases:
abc.ABC
mDNS Beacon base class.
Note
Derived beacons must override the _execute method.
- ip_version¶
IP protocol version to use.
- stop() None [source]¶
Stop Beacon.
Ends zeroconf background threads, and prevent zeroconf instance from servicing further queries.
- property zeroconf: zeroconf._core.Zeroconf¶
Zeroconf instance.
mdns_beacon.beacon module¶
Beacon module.
- class mdns_beacon.beacon.Beacon(aliases: Optional[List[str]] = None, addresses: Optional[List[Union[ipaddress.IPv4Address, ipaddress.IPv6Address]]] = None, port: int = 80, type_: str = 'http', protocol: Literal[tcp, udp] = 'tcp', ttl: int = 60, weight: int = 0, priority: int = 0, properties: Optional[Union[bytes, Dict[str, Any]]] = None, delay_startup: int = 0, *args: Any, **kwargs: Any)[source]¶
Bases:
mdns_beacon.base.BaseBeacon
mDNS Beacon.
- aliases¶
Service alias name list.
- addresses¶
IP addresses that the service runs on.
- port¶
Port that the service runs on.
- type_¶
Service type.
- protocol¶
Service protocol.
- ttl¶
TTL used for the announce of the service.
- weight¶
Weight of the service.
- priority¶
Priority of the service.
- properties¶
Dict of properties (or a bytes object with the content of the text field).
- delay_startup¶
Amount of time to wait before trying to start the zeroconf service (in seconds).
- \*args
Variable length argument list.
- \*\*kwargs
Arbitrary keyword arguments.
- property service_type: str¶
Beacon service type.
- property services: List[zeroconf._services.info.ServiceInfo]¶
Services to register on the local network.
mdns_beacon.listener module¶
mDNS listener module.
- class mdns_beacon.listener.BeaconListener(handlers: Union[zeroconf._services.ServiceListener, List[Callable[[...], None]]], services: Optional[List[str]] = None, timeout: Union[int, float] = 5, *args: Any, **kwargs: Any)[source]¶
Bases:
mdns_beacon.base.BaseBeacon
mDNS Beacon listener.
- handlers¶
Service listeners or functions to be called when a service is added, updated or removed.
- services¶
Fully qualified service type names list.
- timeout¶
Seconds to wait for any responses.
- property default_services: Set[str]¶
Return default services to listen on local networks.
Module contents¶
Top-level package for mdns-beacon.