コード例 #1
0
async def test_entity_id_update_subscriptions(hass, mqtt_mock, setup_tasmota):
    """Test MQTT subscriptions are managed when entity_id is updated."""
    config = copy.deepcopy(DEFAULT_CONFIG)
    config["swc"][0] = 1
    topics = [
        get_topic_stat_switch(config, 0),
        get_topic_tele_sensor(config),
        get_topic_stat_status(config, 8),
        get_topic_tele_will(config),
    ]
    await help_test_entity_id_update_subscriptions(hass, mqtt_mock,
                                                   binary_sensor.DOMAIN,
                                                   config, topics)
コード例 #2
0
ファイル: test_binary_sensor.py プロジェクト: rikroe/core
async def test_entity_id_update_subscriptions(hass, mqtt_mock, setup_tasmota):
    """Test MQTT subscriptions are managed when entity_id is updated."""
    config = copy.deepcopy(DEFAULT_CONFIG)
    config["swc"][0] = 1
    config["swn"][0] = "Test"
    topics = [
        get_topic_stat_result(config),
        get_topic_tele_sensor(config),
        get_topic_stat_status(config, 10),
        get_topic_tele_will(config),
    ]
    await help_test_entity_id_update_subscriptions(hass, mqtt_mock,
                                                   Platform.BINARY_SENSOR,
                                                   config, topics)
コード例 #3
0
ファイル: test_cover.py プロジェクト: OpenPeerPower/core
async def test_entity_id_update_subscriptions(opp, mqtt_mock, setup_tasmota):
    """Test MQTT subscriptions are managed when entity_id is updated."""
    config = copy.deepcopy(DEFAULT_CONFIG)
    config["dn"] = "Test"
    config["rl"][0] = 3
    config["rl"][1] = 3
    topics = [
        get_topic_stat_result(config),
        get_topic_tele_sensor(config),
        get_topic_stat_status(config, 10),
        get_topic_tele_will(config),
    ]
    await help_test_entity_id_update_subscriptions(
        opp, mqtt_mock, cover.DOMAIN, config, topics, entity_id="test_cover_1"
    )
コード例 #4
0
ファイル: test_sensor.py プロジェクト: 2Fake/core
async def test_entity_id_update_subscriptions(hass, mqtt_mock, setup_tasmota):
    """Test MQTT subscriptions are managed when entity_id is updated."""
    config = copy.deepcopy(DEFAULT_CONFIG)
    sensor_config = copy.deepcopy(DEFAULT_SENSOR_CONFIG)
    topics = [
        get_topic_tele_sensor(config),
        get_topic_stat_status(config, 10),
        get_topic_tele_will(config),
    ]
    await help_test_entity_id_update_subscriptions(
        hass,
        mqtt_mock,
        Platform.SENSOR,
        config,
        topics,
        sensor_config,
        "tasmota_dht11_temperature",
    )