Migrate attribution attribute for Arlo (#57504)

This commit is contained in:
Franck Nijhof 2021-10-12 05:40:40 +02:00 committed by GitHub
parent 1a68784852
commit f561543e92
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 5 deletions

View file

@ -7,7 +7,6 @@ import pytest
from homeassistant.components.arlo import DATA_ARLO, sensor as arlo
from homeassistant.components.arlo.sensor import SENSOR_TYPES
from homeassistant.const import (
ATTR_ATTRIBUTION,
DEVICE_CLASS_BATTERY,
DEVICE_CLASS_HUMIDITY,
DEVICE_CLASS_TEMPERATURE,
@ -179,6 +178,13 @@ def test_device_class(default_sensor, temperature_sensor, humidity_sensor):
assert humidity_sensor.device_class == DEVICE_CLASS_HUMIDITY
def test_attribution(default_sensor, temperature_sensor, humidity_sensor):
"""Test the device_class property."""
assert default_sensor.attribution == "Data provided by arlo.netgear.com"
assert temperature_sensor.attribution == "Data provided by arlo.netgear.com"
assert humidity_sensor.attribution == "Data provided by arlo.netgear.com"
def test_update_total_cameras(cameras_sensor):
"""Test update method for total_cameras sensor type."""
cameras_sensor.update()
@ -195,7 +201,6 @@ def _test_attributes(hass, sensor_type):
data = _get_named_tuple({"model_id": "TEST123"})
sensor = _get_sensor(hass, "test", sensor_type, data)
attrs = sensor.extra_state_attributes
assert attrs.get(ATTR_ATTRIBUTION) == "Data provided by arlo.netgear.com"
assert attrs.get("brand") == "Netgear Arlo"
assert attrs.get("model") == "TEST123"
@ -212,7 +217,6 @@ def test_state_attributes(hass):
def test_attributes_total_cameras(cameras_sensor):
"""Test attributes for total cameras sensor type."""
attrs = cameras_sensor.extra_state_attributes
assert attrs.get(ATTR_ATTRIBUTION) == "Data provided by arlo.netgear.com"
assert attrs.get("brand") == "Netgear Arlo"
assert attrs.get("model") is None