Increase static type coverage for nest integration (#53475)
Co-authored-by: Mick Vleeshouwer <mick@imick.nl> Co-authored-by: Franck Nijhof <git@frenck.dev>
This commit is contained in:
parent
d4c4263730
commit
6376b4be5c
19 changed files with 146 additions and 110 deletions
|
@ -2,7 +2,7 @@
|
|||
|
||||
from google_nest_sdm.device import Device
|
||||
|
||||
from homeassistant.components.nest.device_info import DeviceInfo
|
||||
from homeassistant.components.nest.device_info import NestDeviceInfo
|
||||
|
||||
|
||||
def test_device_custom_name():
|
||||
|
@ -20,7 +20,7 @@ def test_device_custom_name():
|
|||
auth=None,
|
||||
)
|
||||
|
||||
device_info = DeviceInfo(device)
|
||||
device_info = NestDeviceInfo(device)
|
||||
assert device_info.device_name == "My Doorbell"
|
||||
assert device_info.device_model == "Doorbell"
|
||||
assert device_info.device_brand == "Google Nest"
|
||||
|
@ -45,7 +45,7 @@ def test_device_name_room():
|
|||
auth=None,
|
||||
)
|
||||
|
||||
device_info = DeviceInfo(device)
|
||||
device_info = NestDeviceInfo(device)
|
||||
assert device_info.device_name == "Some Room"
|
||||
assert device_info.device_model == "Doorbell"
|
||||
assert device_info.device_brand == "Google Nest"
|
||||
|
@ -64,7 +64,7 @@ def test_device_no_name():
|
|||
auth=None,
|
||||
)
|
||||
|
||||
device_info = DeviceInfo(device)
|
||||
device_info = NestDeviceInfo(device)
|
||||
assert device_info.device_name == "Doorbell"
|
||||
assert device_info.device_model == "Doorbell"
|
||||
assert device_info.device_brand == "Google Nest"
|
||||
|
@ -91,13 +91,13 @@ def test_device_invalid_type():
|
|||
auth=None,
|
||||
)
|
||||
|
||||
device_info = DeviceInfo(device)
|
||||
device_info = NestDeviceInfo(device)
|
||||
assert device_info.device_name == "My Doorbell"
|
||||
assert device_info.device_model is None
|
||||
assert device_info.device_model == "Unknown"
|
||||
assert device_info.device_brand == "Google Nest"
|
||||
assert device_info.device_info == {
|
||||
"identifiers": {("nest", "some-device-id")},
|
||||
"name": "My Doorbell",
|
||||
"manufacturer": "Google Nest",
|
||||
"model": None,
|
||||
"model": "Unknown",
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue