Example #1
0
def publish_template(opp: OpenPeerPower,
                     topic,
                     payload_template,
                     qos=None,
                     retain=None) -> None:
    """Publish message to an MQTT topic."""
    opp.add_job(async_publish_template, opp, topic, payload_template, qos,
                retain)
Example #2
0
def load_platform(
    opp: core.OpenPeerPower,
    component: str,
    platform: str,
    discovered: DiscoveryInfoType,
    opp_config: ConfigType,
) -> None:
    """Load a component and platform dynamically."""
    opp.add_job(
        async_load_platform(  # type: ignore
            opp, component, platform, discovered, opp_config))
Example #3
0
def discover(
    opp: core.OpenPeerPower,
    service: str,
    discovered: DiscoveryInfoType,
    component: str,
    opp_config: ConfigType,
) -> None:
    """Fire discovery event. Can ensure a component is loaded."""
    opp.add_job(
        async_discover(opp, service, discovered, component,
                       opp_config)  # type: ignore
    )