Bump xiaomi-ble to 0.9.3 (#78301)
parent
b21a37cad5
commit
cd7f65bb6a
|
@ -9,7 +9,7 @@
|
|||
"service_data_uuid": "0000fe95-0000-1000-8000-00805f9b34fb"
|
||||
}
|
||||
],
|
||||
"requirements": ["xiaomi-ble==0.9.0"],
|
||||
"requirements": ["xiaomi-ble==0.9.3"],
|
||||
"dependencies": ["bluetooth"],
|
||||
"codeowners": ["@Jc2k", "@Ernst79"],
|
||||
"iot_class": "local_push"
|
||||
|
|
|
@ -2528,7 +2528,7 @@ xbox-webapi==2.0.11
|
|||
xboxapi==2.0.1
|
||||
|
||||
# homeassistant.components.xiaomi_ble
|
||||
xiaomi-ble==0.9.0
|
||||
xiaomi-ble==0.9.3
|
||||
|
||||
# homeassistant.components.knx
|
||||
xknx==1.0.2
|
||||
|
|
|
@ -1735,7 +1735,7 @@ wolf_smartset==0.1.11
|
|||
xbox-webapi==2.0.11
|
||||
|
||||
# homeassistant.components.xiaomi_ble
|
||||
xiaomi-ble==0.9.0
|
||||
xiaomi-ble==0.9.3
|
||||
|
||||
# homeassistant.components.knx
|
||||
xknx==1.0.2
|
||||
|
|
|
@ -45,10 +45,10 @@ async def test_smoke_sensor(hass):
|
|||
await hass.async_block_till_done()
|
||||
assert len(hass.states.async_all()) == 1
|
||||
|
||||
smoke_sensor = hass.states.get("binary_sensor.thermometer_e39cbc_smoke")
|
||||
smoke_sensor = hass.states.get("binary_sensor.thermometer_9cbc_smoke")
|
||||
smoke_sensor_attribtes = smoke_sensor.attributes
|
||||
assert smoke_sensor.state == "on"
|
||||
assert smoke_sensor_attribtes[ATTR_FRIENDLY_NAME] == "Thermometer E39CBC Smoke"
|
||||
assert smoke_sensor_attribtes[ATTR_FRIENDLY_NAME] == "Thermometer 9CBC Smoke"
|
||||
|
||||
assert await hass.config_entries.async_unload(entry.entry_id)
|
||||
await hass.async_block_till_done()
|
||||
|
@ -90,10 +90,10 @@ async def test_moisture(hass):
|
|||
await hass.async_block_till_done()
|
||||
assert len(hass.states.async_all()) == 1
|
||||
|
||||
sensor = hass.states.get("binary_sensor.smart_flower_pot_6a3e7a_moisture")
|
||||
sensor = hass.states.get("binary_sensor.smart_flower_pot_3e7a_moisture")
|
||||
sensor_attr = sensor.attributes
|
||||
assert sensor.state == "on"
|
||||
assert sensor_attr[ATTR_FRIENDLY_NAME] == "Smart Flower Pot 6A3E7A Moisture"
|
||||
assert sensor_attr[ATTR_FRIENDLY_NAME] == "Smart Flower Pot 3E7A Moisture"
|
||||
|
||||
assert await hass.config_entries.async_unload(entry.entry_id)
|
||||
await hass.async_block_till_done()
|
||||
|
|
|
@ -39,7 +39,7 @@ async def test_async_step_bluetooth_valid_device(hass):
|
|||
result["flow_id"], user_input={}
|
||||
)
|
||||
assert result2["type"] == FlowResultType.CREATE_ENTRY
|
||||
assert result2["title"] == "Baby Thermometer DD6FC1 (MMC-T201-1)"
|
||||
assert result2["title"] == "Baby Thermometer 6FC1 (MMC-T201-1)"
|
||||
assert result2["data"] == {}
|
||||
assert result2["result"].unique_id == "00:81:F9:DD:6F:C1"
|
||||
|
||||
|
@ -65,7 +65,7 @@ async def test_async_step_bluetooth_valid_device_but_missing_payload(hass):
|
|||
result["flow_id"], user_input={}
|
||||
)
|
||||
assert result2["type"] == FlowResultType.CREATE_ENTRY
|
||||
assert result2["title"] == "Temperature/Humidity Sensor 565384 (LYWSD03MMC)"
|
||||
assert result2["title"] == "Temperature/Humidity Sensor 5384 (LYWSD03MMC)"
|
||||
assert result2["data"] == {}
|
||||
assert result2["result"].unique_id == "A4:C1:38:56:53:84"
|
||||
|
||||
|
@ -123,7 +123,7 @@ async def test_async_step_bluetooth_during_onboarding(hass):
|
|||
)
|
||||
|
||||
assert result["type"] == FlowResultType.CREATE_ENTRY
|
||||
assert result["title"] == "Baby Thermometer DD6FC1 (MMC-T201-1)"
|
||||
assert result["title"] == "Baby Thermometer 6FC1 (MMC-T201-1)"
|
||||
assert result["data"] == {}
|
||||
assert result["result"].unique_id == "00:81:F9:DD:6F:C1"
|
||||
assert len(mock_setup_entry.mock_calls) == 1
|
||||
|
@ -148,7 +148,7 @@ async def test_async_step_bluetooth_valid_device_legacy_encryption(hass):
|
|||
user_input={"bindkey": "b853075158487ca39a5b5ea9"},
|
||||
)
|
||||
assert result2["type"] == FlowResultType.CREATE_ENTRY
|
||||
assert result2["title"] == "Dimmer Switch C5988B (YLKG07YL/YLKG08YL)"
|
||||
assert result2["title"] == "Dimmer Switch 988B (YLKG07YL/YLKG08YL)"
|
||||
assert result2["data"] == {"bindkey": "b853075158487ca39a5b5ea9"}
|
||||
assert result2["result"].unique_id == "F8:24:41:C5:98:8B"
|
||||
|
||||
|
@ -180,7 +180,7 @@ async def test_async_step_bluetooth_valid_device_legacy_encryption_wrong_key(has
|
|||
user_input={"bindkey": "b853075158487ca39a5b5ea9"},
|
||||
)
|
||||
assert result2["type"] == FlowResultType.CREATE_ENTRY
|
||||
assert result2["title"] == "Dimmer Switch C5988B (YLKG07YL/YLKG08YL)"
|
||||
assert result2["title"] == "Dimmer Switch 988B (YLKG07YL/YLKG08YL)"
|
||||
assert result2["data"] == {"bindkey": "b853075158487ca39a5b5ea9"}
|
||||
assert result2["result"].unique_id == "F8:24:41:C5:98:8B"
|
||||
|
||||
|
@ -214,7 +214,7 @@ async def test_async_step_bluetooth_valid_device_legacy_encryption_wrong_key_len
|
|||
user_input={"bindkey": "b853075158487ca39a5b5ea9"},
|
||||
)
|
||||
assert result2["type"] == FlowResultType.CREATE_ENTRY
|
||||
assert result2["title"] == "Dimmer Switch C5988B (YLKG07YL/YLKG08YL)"
|
||||
assert result2["title"] == "Dimmer Switch 988B (YLKG07YL/YLKG08YL)"
|
||||
assert result2["data"] == {"bindkey": "b853075158487ca39a5b5ea9"}
|
||||
assert result2["result"].unique_id == "F8:24:41:C5:98:8B"
|
||||
|
||||
|
@ -238,7 +238,7 @@ async def test_async_step_bluetooth_valid_device_v4_encryption(hass):
|
|||
)
|
||||
|
||||
assert result2["type"] == FlowResultType.CREATE_ENTRY
|
||||
assert result2["title"] == "Thermometer E39CBC (JTYJGD03MI)"
|
||||
assert result2["title"] == "Thermometer 9CBC (JTYJGD03MI)"
|
||||
assert result2["data"] == {"bindkey": "5b51a7c91cde6707c9ef18dfda143a58"}
|
||||
assert result2["result"].unique_id == "54:EF:44:E3:9C:BC"
|
||||
|
||||
|
@ -272,7 +272,7 @@ async def test_async_step_bluetooth_valid_device_v4_encryption_wrong_key(hass):
|
|||
)
|
||||
|
||||
assert result2["type"] == FlowResultType.CREATE_ENTRY
|
||||
assert result2["title"] == "Thermometer E39CBC (JTYJGD03MI)"
|
||||
assert result2["title"] == "Thermometer 9CBC (JTYJGD03MI)"
|
||||
assert result2["data"] == {"bindkey": "5b51a7c91cde6707c9ef18dfda143a58"}
|
||||
assert result2["result"].unique_id == "54:EF:44:E3:9C:BC"
|
||||
|
||||
|
@ -306,7 +306,7 @@ async def test_async_step_bluetooth_valid_device_v4_encryption_wrong_key_length(
|
|||
)
|
||||
|
||||
assert result2["type"] == FlowResultType.CREATE_ENTRY
|
||||
assert result2["title"] == "Thermometer E39CBC (JTYJGD03MI)"
|
||||
assert result2["title"] == "Thermometer 9CBC (JTYJGD03MI)"
|
||||
assert result2["data"] == {"bindkey": "5b51a7c91cde6707c9ef18dfda143a58"}
|
||||
assert result2["result"].unique_id == "54:EF:44:E3:9C:BC"
|
||||
|
||||
|
@ -370,7 +370,7 @@ async def test_async_step_user_with_found_devices(hass):
|
|||
user_input={"address": "58:2D:34:35:93:21"},
|
||||
)
|
||||
assert result2["type"] == FlowResultType.CREATE_ENTRY
|
||||
assert result2["title"] == "Temperature/Humidity Sensor 359321 (LYWSDCGQ)"
|
||||
assert result2["title"] == "Temperature/Humidity Sensor 9321 (LYWSDCGQ)"
|
||||
assert result2["data"] == {}
|
||||
assert result2["result"].unique_id == "58:2D:34:35:93:21"
|
||||
|
||||
|
@ -405,7 +405,7 @@ async def test_async_step_user_short_payload(hass):
|
|||
result["flow_id"], user_input={}
|
||||
)
|
||||
assert result3["type"] == FlowResultType.CREATE_ENTRY
|
||||
assert result3["title"] == "Temperature/Humidity Sensor 565384 (LYWSD03MMC)"
|
||||
assert result3["title"] == "Temperature/Humidity Sensor 5384 (LYWSD03MMC)"
|
||||
assert result3["data"] == {}
|
||||
assert result3["result"].unique_id == "A4:C1:38:56:53:84"
|
||||
|
||||
|
@ -453,7 +453,7 @@ async def test_async_step_user_short_payload_then_full(hass):
|
|||
)
|
||||
|
||||
assert result2["type"] == FlowResultType.CREATE_ENTRY
|
||||
assert result2["title"] == "Temperature/Humidity Sensor 565384 (LYWSD03MMC)"
|
||||
assert result2["title"] == "Temperature/Humidity Sensor 5384 (LYWSD03MMC)"
|
||||
assert result2["data"] == {"bindkey": "a115210eed7a88e50ad52662e732a9fb"}
|
||||
|
||||
|
||||
|
@ -486,7 +486,7 @@ async def test_async_step_user_with_found_devices_v4_encryption(hass):
|
|||
)
|
||||
|
||||
assert result2["type"] == FlowResultType.CREATE_ENTRY
|
||||
assert result2["title"] == "Thermometer E39CBC (JTYJGD03MI)"
|
||||
assert result2["title"] == "Thermometer 9CBC (JTYJGD03MI)"
|
||||
assert result2["data"] == {"bindkey": "5b51a7c91cde6707c9ef18dfda143a58"}
|
||||
assert result2["result"].unique_id == "54:EF:44:E3:9C:BC"
|
||||
|
||||
|
@ -532,7 +532,7 @@ async def test_async_step_user_with_found_devices_v4_encryption_wrong_key(hass):
|
|||
)
|
||||
|
||||
assert result2["type"] == FlowResultType.CREATE_ENTRY
|
||||
assert result2["title"] == "Thermometer E39CBC (JTYJGD03MI)"
|
||||
assert result2["title"] == "Thermometer 9CBC (JTYJGD03MI)"
|
||||
assert result2["data"] == {"bindkey": "5b51a7c91cde6707c9ef18dfda143a58"}
|
||||
assert result2["result"].unique_id == "54:EF:44:E3:9C:BC"
|
||||
|
||||
|
@ -580,7 +580,7 @@ async def test_async_step_user_with_found_devices_v4_encryption_wrong_key_length
|
|||
)
|
||||
|
||||
assert result2["type"] == FlowResultType.CREATE_ENTRY
|
||||
assert result2["title"] == "Thermometer E39CBC (JTYJGD03MI)"
|
||||
assert result2["title"] == "Thermometer 9CBC (JTYJGD03MI)"
|
||||
assert result2["data"] == {"bindkey": "5b51a7c91cde6707c9ef18dfda143a58"}
|
||||
assert result2["result"].unique_id == "54:EF:44:E3:9C:BC"
|
||||
|
||||
|
@ -613,7 +613,7 @@ async def test_async_step_user_with_found_devices_legacy_encryption(hass):
|
|||
user_input={"bindkey": "b853075158487ca39a5b5ea9"},
|
||||
)
|
||||
assert result2["type"] == FlowResultType.CREATE_ENTRY
|
||||
assert result2["title"] == "Dimmer Switch C5988B (YLKG07YL/YLKG08YL)"
|
||||
assert result2["title"] == "Dimmer Switch 988B (YLKG07YL/YLKG08YL)"
|
||||
assert result2["data"] == {"bindkey": "b853075158487ca39a5b5ea9"}
|
||||
assert result2["result"].unique_id == "F8:24:41:C5:98:8B"
|
||||
|
||||
|
@ -658,7 +658,7 @@ async def test_async_step_user_with_found_devices_legacy_encryption_wrong_key(
|
|||
user_input={"bindkey": "b853075158487ca39a5b5ea9"},
|
||||
)
|
||||
assert result2["type"] == FlowResultType.CREATE_ENTRY
|
||||
assert result2["title"] == "Dimmer Switch C5988B (YLKG07YL/YLKG08YL)"
|
||||
assert result2["title"] == "Dimmer Switch 988B (YLKG07YL/YLKG08YL)"
|
||||
assert result2["data"] == {"bindkey": "b853075158487ca39a5b5ea9"}
|
||||
assert result2["result"].unique_id == "F8:24:41:C5:98:8B"
|
||||
|
||||
|
@ -703,7 +703,7 @@ async def test_async_step_user_with_found_devices_legacy_encryption_wrong_key_le
|
|||
user_input={"bindkey": "b853075158487ca39a5b5ea9"},
|
||||
)
|
||||
assert result2["type"] == FlowResultType.CREATE_ENTRY
|
||||
assert result2["title"] == "Dimmer Switch C5988B (YLKG07YL/YLKG08YL)"
|
||||
assert result2["title"] == "Dimmer Switch 988B (YLKG07YL/YLKG08YL)"
|
||||
assert result2["data"] == {"bindkey": "b853075158487ca39a5b5ea9"}
|
||||
assert result2["result"].unique_id == "F8:24:41:C5:98:8B"
|
||||
|
||||
|
@ -822,7 +822,7 @@ async def test_async_step_user_takes_precedence_over_discovery(hass):
|
|||
user_input={"address": "00:81:F9:DD:6F:C1"},
|
||||
)
|
||||
assert result2["type"] == FlowResultType.CREATE_ENTRY
|
||||
assert result2["title"] == "Baby Thermometer DD6FC1 (MMC-T201-1)"
|
||||
assert result2["title"] == "Baby Thermometer 6FC1 (MMC-T201-1)"
|
||||
assert result2["data"] == {}
|
||||
assert result2["result"].unique_id == "00:81:F9:DD:6F:C1"
|
||||
|
||||
|
|
|
@ -42,12 +42,11 @@ async def test_sensors(hass):
|
|||
await hass.async_block_till_done()
|
||||
assert len(hass.states.async_all()) == 2
|
||||
|
||||
temp_sensor = hass.states.get("sensor.baby_thermometer_dd6fc1_temperature")
|
||||
temp_sensor = hass.states.get("sensor.baby_thermometer_6fc1_temperature")
|
||||
temp_sensor_attribtes = temp_sensor.attributes
|
||||
assert temp_sensor.state == "36.8719980616822"
|
||||
assert (
|
||||
temp_sensor_attribtes[ATTR_FRIENDLY_NAME]
|
||||
== "Baby Thermometer DD6FC1 Temperature"
|
||||
temp_sensor_attribtes[ATTR_FRIENDLY_NAME] == "Baby Thermometer 6FC1 Temperature"
|
||||
)
|
||||
assert temp_sensor_attribtes[ATTR_UNIT_OF_MEASUREMENT] == "°C"
|
||||
assert temp_sensor_attribtes[ATTR_STATE_CLASS] == "measurement"
|
||||
|
@ -92,10 +91,10 @@ async def test_xiaomi_formaldeyhde(hass):
|
|||
await hass.async_block_till_done()
|
||||
assert len(hass.states.async_all()) == 1
|
||||
|
||||
sensor = hass.states.get("sensor.smart_flower_pot_6a3e7a_formaldehyde")
|
||||
sensor = hass.states.get("sensor.smart_flower_pot_3e7a_formaldehyde")
|
||||
sensor_attr = sensor.attributes
|
||||
assert sensor.state == "2.44"
|
||||
assert sensor_attr[ATTR_FRIENDLY_NAME] == "Smart Flower Pot 6A3E7A Formaldehyde"
|
||||
assert sensor_attr[ATTR_FRIENDLY_NAME] == "Smart Flower Pot 3E7A Formaldehyde"
|
||||
assert sensor_attr[ATTR_UNIT_OF_MEASUREMENT] == "mg/m³"
|
||||
assert sensor_attr[ATTR_STATE_CLASS] == "measurement"
|
||||
|
||||
|
@ -139,10 +138,10 @@ async def test_xiaomi_consumable(hass):
|
|||
await hass.async_block_till_done()
|
||||
assert len(hass.states.async_all()) == 1
|
||||
|
||||
sensor = hass.states.get("sensor.smart_flower_pot_6a3e7a_consumable")
|
||||
sensor = hass.states.get("sensor.smart_flower_pot_3e7a_consumable")
|
||||
sensor_attr = sensor.attributes
|
||||
assert sensor.state == "96"
|
||||
assert sensor_attr[ATTR_FRIENDLY_NAME] == "Smart Flower Pot 6A3E7A Consumable"
|
||||
assert sensor_attr[ATTR_FRIENDLY_NAME] == "Smart Flower Pot 3E7A Consumable"
|
||||
assert sensor_attr[ATTR_UNIT_OF_MEASUREMENT] == "%"
|
||||
assert sensor_attr[ATTR_STATE_CLASS] == "measurement"
|
||||
|
||||
|
@ -186,17 +185,17 @@ async def test_xiaomi_battery_voltage(hass):
|
|||
await hass.async_block_till_done()
|
||||
assert len(hass.states.async_all()) == 2
|
||||
|
||||
volt_sensor = hass.states.get("sensor.smart_flower_pot_6a3e7a_voltage")
|
||||
volt_sensor = hass.states.get("sensor.smart_flower_pot_3e7a_voltage")
|
||||
volt_sensor_attr = volt_sensor.attributes
|
||||
assert volt_sensor.state == "3.1"
|
||||
assert volt_sensor_attr[ATTR_FRIENDLY_NAME] == "Smart Flower Pot 6A3E7A Voltage"
|
||||
assert volt_sensor_attr[ATTR_FRIENDLY_NAME] == "Smart Flower Pot 3E7A Voltage"
|
||||
assert volt_sensor_attr[ATTR_UNIT_OF_MEASUREMENT] == "V"
|
||||
assert volt_sensor_attr[ATTR_STATE_CLASS] == "measurement"
|
||||
|
||||
bat_sensor = hass.states.get("sensor.smart_flower_pot_6a3e7a_battery")
|
||||
bat_sensor = hass.states.get("sensor.smart_flower_pot_3e7a_battery")
|
||||
bat_sensor_attr = bat_sensor.attributes
|
||||
assert bat_sensor.state == "100"
|
||||
assert bat_sensor_attr[ATTR_FRIENDLY_NAME] == "Smart Flower Pot 6A3E7A Battery"
|
||||
assert bat_sensor_attr[ATTR_FRIENDLY_NAME] == "Smart Flower Pot 3E7A Battery"
|
||||
assert bat_sensor_attr[ATTR_UNIT_OF_MEASUREMENT] == "%"
|
||||
assert bat_sensor_attr[ATTR_STATE_CLASS] == "measurement"
|
||||
|
||||
|
@ -254,42 +253,38 @@ async def test_xiaomi_HHCCJCY01(hass):
|
|||
await hass.async_block_till_done()
|
||||
assert len(hass.states.async_all()) == 5
|
||||
|
||||
illum_sensor = hass.states.get("sensor.plant_sensor_6a3e7a_illuminance")
|
||||
illum_sensor = hass.states.get("sensor.plant_sensor_3e7a_illuminance")
|
||||
illum_sensor_attr = illum_sensor.attributes
|
||||
assert illum_sensor.state == "0"
|
||||
assert illum_sensor_attr[ATTR_FRIENDLY_NAME] == "Plant Sensor 6A3E7A Illuminance"
|
||||
assert illum_sensor_attr[ATTR_FRIENDLY_NAME] == "Plant Sensor 3E7A Illuminance"
|
||||
assert illum_sensor_attr[ATTR_UNIT_OF_MEASUREMENT] == "lx"
|
||||
assert illum_sensor_attr[ATTR_STATE_CLASS] == "measurement"
|
||||
|
||||
cond_sensor = hass.states.get("sensor.plant_sensor_6a3e7a_conductivity")
|
||||
cond_sensor = hass.states.get("sensor.plant_sensor_3e7a_conductivity")
|
||||
cond_sensor_attribtes = cond_sensor.attributes
|
||||
assert cond_sensor.state == "599"
|
||||
assert (
|
||||
cond_sensor_attribtes[ATTR_FRIENDLY_NAME] == "Plant Sensor 6A3E7A Conductivity"
|
||||
)
|
||||
assert cond_sensor_attribtes[ATTR_FRIENDLY_NAME] == "Plant Sensor 3E7A Conductivity"
|
||||
assert cond_sensor_attribtes[ATTR_UNIT_OF_MEASUREMENT] == "µS/cm"
|
||||
assert cond_sensor_attribtes[ATTR_STATE_CLASS] == "measurement"
|
||||
|
||||
moist_sensor = hass.states.get("sensor.plant_sensor_6a3e7a_moisture")
|
||||
moist_sensor = hass.states.get("sensor.plant_sensor_3e7a_moisture")
|
||||
moist_sensor_attribtes = moist_sensor.attributes
|
||||
assert moist_sensor.state == "64"
|
||||
assert moist_sensor_attribtes[ATTR_FRIENDLY_NAME] == "Plant Sensor 6A3E7A Moisture"
|
||||
assert moist_sensor_attribtes[ATTR_FRIENDLY_NAME] == "Plant Sensor 3E7A Moisture"
|
||||
assert moist_sensor_attribtes[ATTR_UNIT_OF_MEASUREMENT] == "%"
|
||||
assert moist_sensor_attribtes[ATTR_STATE_CLASS] == "measurement"
|
||||
|
||||
temp_sensor = hass.states.get("sensor.plant_sensor_6a3e7a_temperature")
|
||||
temp_sensor = hass.states.get("sensor.plant_sensor_3e7a_temperature")
|
||||
temp_sensor_attribtes = temp_sensor.attributes
|
||||
assert temp_sensor.state == "24.4"
|
||||
assert (
|
||||
temp_sensor_attribtes[ATTR_FRIENDLY_NAME] == "Plant Sensor 6A3E7A Temperature"
|
||||
)
|
||||
assert temp_sensor_attribtes[ATTR_FRIENDLY_NAME] == "Plant Sensor 3E7A Temperature"
|
||||
assert temp_sensor_attribtes[ATTR_UNIT_OF_MEASUREMENT] == "°C"
|
||||
assert temp_sensor_attribtes[ATTR_STATE_CLASS] == "measurement"
|
||||
|
||||
batt_sensor = hass.states.get("sensor.plant_sensor_6a3e7a_battery")
|
||||
batt_sensor = hass.states.get("sensor.plant_sensor_3e7a_battery")
|
||||
batt_sensor_attribtes = batt_sensor.attributes
|
||||
assert batt_sensor.state == "5"
|
||||
assert batt_sensor_attribtes[ATTR_FRIENDLY_NAME] == "Plant Sensor 6A3E7A Battery"
|
||||
assert batt_sensor_attribtes[ATTR_FRIENDLY_NAME] == "Plant Sensor 3E7A Battery"
|
||||
assert batt_sensor_attribtes[ATTR_UNIT_OF_MEASUREMENT] == "%"
|
||||
assert batt_sensor_attribtes[ATTR_STATE_CLASS] == "measurement"
|
||||
|
||||
|
@ -355,35 +350,31 @@ async def test_xiaomi_HHCCJCY01_not_connectable(hass):
|
|||
await hass.async_block_till_done()
|
||||
assert len(hass.states.async_all()) == 4
|
||||
|
||||
illum_sensor = hass.states.get("sensor.plant_sensor_6a3e7a_illuminance")
|
||||
illum_sensor = hass.states.get("sensor.plant_sensor_3e7a_illuminance")
|
||||
illum_sensor_attr = illum_sensor.attributes
|
||||
assert illum_sensor.state == "0"
|
||||
assert illum_sensor_attr[ATTR_FRIENDLY_NAME] == "Plant Sensor 6A3E7A Illuminance"
|
||||
assert illum_sensor_attr[ATTR_FRIENDLY_NAME] == "Plant Sensor 3E7A Illuminance"
|
||||
assert illum_sensor_attr[ATTR_UNIT_OF_MEASUREMENT] == "lx"
|
||||
assert illum_sensor_attr[ATTR_STATE_CLASS] == "measurement"
|
||||
|
||||
cond_sensor = hass.states.get("sensor.plant_sensor_6a3e7a_conductivity")
|
||||
cond_sensor = hass.states.get("sensor.plant_sensor_3e7a_conductivity")
|
||||
cond_sensor_attribtes = cond_sensor.attributes
|
||||
assert cond_sensor.state == "599"
|
||||
assert (
|
||||
cond_sensor_attribtes[ATTR_FRIENDLY_NAME] == "Plant Sensor 6A3E7A Conductivity"
|
||||
)
|
||||
assert cond_sensor_attribtes[ATTR_FRIENDLY_NAME] == "Plant Sensor 3E7A Conductivity"
|
||||
assert cond_sensor_attribtes[ATTR_UNIT_OF_MEASUREMENT] == "µS/cm"
|
||||
assert cond_sensor_attribtes[ATTR_STATE_CLASS] == "measurement"
|
||||
|
||||
moist_sensor = hass.states.get("sensor.plant_sensor_6a3e7a_moisture")
|
||||
moist_sensor = hass.states.get("sensor.plant_sensor_3e7a_moisture")
|
||||
moist_sensor_attribtes = moist_sensor.attributes
|
||||
assert moist_sensor.state == "64"
|
||||
assert moist_sensor_attribtes[ATTR_FRIENDLY_NAME] == "Plant Sensor 6A3E7A Moisture"
|
||||
assert moist_sensor_attribtes[ATTR_FRIENDLY_NAME] == "Plant Sensor 3E7A Moisture"
|
||||
assert moist_sensor_attribtes[ATTR_UNIT_OF_MEASUREMENT] == "%"
|
||||
assert moist_sensor_attribtes[ATTR_STATE_CLASS] == "measurement"
|
||||
|
||||
temp_sensor = hass.states.get("sensor.plant_sensor_6a3e7a_temperature")
|
||||
temp_sensor = hass.states.get("sensor.plant_sensor_3e7a_temperature")
|
||||
temp_sensor_attribtes = temp_sensor.attributes
|
||||
assert temp_sensor.state == "24.4"
|
||||
assert (
|
||||
temp_sensor_attribtes[ATTR_FRIENDLY_NAME] == "Plant Sensor 6A3E7A Temperature"
|
||||
)
|
||||
assert temp_sensor_attribtes[ATTR_FRIENDLY_NAME] == "Plant Sensor 3E7A Temperature"
|
||||
assert temp_sensor_attribtes[ATTR_UNIT_OF_MEASUREMENT] == "°C"
|
||||
assert temp_sensor_attribtes[ATTR_STATE_CLASS] == "measurement"
|
||||
|
||||
|
@ -438,42 +429,38 @@ async def test_xiaomi_HHCCJCY01_only_some_sources_connectable(hass):
|
|||
await hass.async_block_till_done()
|
||||
assert len(hass.states.async_all()) == 5
|
||||
|
||||
illum_sensor = hass.states.get("sensor.plant_sensor_6a3e7a_illuminance")
|
||||
illum_sensor = hass.states.get("sensor.plant_sensor_3e7a_illuminance")
|
||||
illum_sensor_attr = illum_sensor.attributes
|
||||
assert illum_sensor.state == "0"
|
||||
assert illum_sensor_attr[ATTR_FRIENDLY_NAME] == "Plant Sensor 6A3E7A Illuminance"
|
||||
assert illum_sensor_attr[ATTR_FRIENDLY_NAME] == "Plant Sensor 3E7A Illuminance"
|
||||
assert illum_sensor_attr[ATTR_UNIT_OF_MEASUREMENT] == "lx"
|
||||
assert illum_sensor_attr[ATTR_STATE_CLASS] == "measurement"
|
||||
|
||||
cond_sensor = hass.states.get("sensor.plant_sensor_6a3e7a_conductivity")
|
||||
cond_sensor = hass.states.get("sensor.plant_sensor_3e7a_conductivity")
|
||||
cond_sensor_attribtes = cond_sensor.attributes
|
||||
assert cond_sensor.state == "599"
|
||||
assert (
|
||||
cond_sensor_attribtes[ATTR_FRIENDLY_NAME] == "Plant Sensor 6A3E7A Conductivity"
|
||||
)
|
||||
assert cond_sensor_attribtes[ATTR_FRIENDLY_NAME] == "Plant Sensor 3E7A Conductivity"
|
||||
assert cond_sensor_attribtes[ATTR_UNIT_OF_MEASUREMENT] == "µS/cm"
|
||||
assert cond_sensor_attribtes[ATTR_STATE_CLASS] == "measurement"
|
||||
|
||||
moist_sensor = hass.states.get("sensor.plant_sensor_6a3e7a_moisture")
|
||||
moist_sensor = hass.states.get("sensor.plant_sensor_3e7a_moisture")
|
||||
moist_sensor_attribtes = moist_sensor.attributes
|
||||
assert moist_sensor.state == "64"
|
||||
assert moist_sensor_attribtes[ATTR_FRIENDLY_NAME] == "Plant Sensor 6A3E7A Moisture"
|
||||
assert moist_sensor_attribtes[ATTR_FRIENDLY_NAME] == "Plant Sensor 3E7A Moisture"
|
||||
assert moist_sensor_attribtes[ATTR_UNIT_OF_MEASUREMENT] == "%"
|
||||
assert moist_sensor_attribtes[ATTR_STATE_CLASS] == "measurement"
|
||||
|
||||
temp_sensor = hass.states.get("sensor.plant_sensor_6a3e7a_temperature")
|
||||
temp_sensor = hass.states.get("sensor.plant_sensor_3e7a_temperature")
|
||||
temp_sensor_attribtes = temp_sensor.attributes
|
||||
assert temp_sensor.state == "24.4"
|
||||
assert (
|
||||
temp_sensor_attribtes[ATTR_FRIENDLY_NAME] == "Plant Sensor 6A3E7A Temperature"
|
||||
)
|
||||
assert temp_sensor_attribtes[ATTR_FRIENDLY_NAME] == "Plant Sensor 3E7A Temperature"
|
||||
assert temp_sensor_attribtes[ATTR_UNIT_OF_MEASUREMENT] == "°C"
|
||||
assert temp_sensor_attribtes[ATTR_STATE_CLASS] == "measurement"
|
||||
|
||||
batt_sensor = hass.states.get("sensor.plant_sensor_6a3e7a_battery")
|
||||
batt_sensor = hass.states.get("sensor.plant_sensor_3e7a_battery")
|
||||
batt_sensor_attribtes = batt_sensor.attributes
|
||||
assert batt_sensor.state == "5"
|
||||
assert batt_sensor_attribtes[ATTR_FRIENDLY_NAME] == "Plant Sensor 6A3E7A Battery"
|
||||
assert batt_sensor_attribtes[ATTR_FRIENDLY_NAME] == "Plant Sensor 3E7A Battery"
|
||||
assert batt_sensor_attribtes[ATTR_UNIT_OF_MEASUREMENT] == "%"
|
||||
assert batt_sensor_attribtes[ATTR_STATE_CLASS] == "measurement"
|
||||
|
||||
|
@ -515,14 +502,12 @@ async def test_xiaomi_CGDK2(hass):
|
|||
await hass.async_block_till_done()
|
||||
assert len(hass.states.async_all()) == 1
|
||||
|
||||
temp_sensor = hass.states.get(
|
||||
"sensor.temperature_humidity_sensor_122089_temperature"
|
||||
)
|
||||
temp_sensor = hass.states.get("sensor.temperature_humidity_sensor_2089_temperature")
|
||||
temp_sensor_attribtes = temp_sensor.attributes
|
||||
assert temp_sensor.state == "22.6"
|
||||
assert (
|
||||
temp_sensor_attribtes[ATTR_FRIENDLY_NAME]
|
||||
== "Temperature/Humidity Sensor 122089 Temperature"
|
||||
== "Temperature/Humidity Sensor 2089 Temperature"
|
||||
)
|
||||
assert temp_sensor_attribtes[ATTR_UNIT_OF_MEASUREMENT] == "°C"
|
||||
assert temp_sensor_attribtes[ATTR_STATE_CLASS] == "measurement"
|
||||
|
|
Loading…
Reference in New Issue