Migrate attribution attribute for Picnic (#57507)

This commit is contained in:
Franck Nijhof 2021-10-12 05:39:51 +02:00 committed by GitHub
parent 580b5fb812
commit e94bebdf7b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View File

@ -5,7 +5,6 @@ from typing import Any
from homeassistant.components.sensor import SensorEntity
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import ATTR_ATTRIBUTION
from homeassistant.core import HomeAssistant
from homeassistant.helpers.typing import StateType
from homeassistant.helpers.update_coordinator import (
@ -41,8 +40,8 @@ async def async_setup_entry(
class PicnicSensor(SensorEntity, CoordinatorEntity):
"""The CoordinatorEntity subclass representing Picnic sensors."""
_attr_attribution = ATTRIBUTION
entity_description: PicnicSensorEntityDescription
_attr_extra_state_attributes = {ATTR_ATTRIBUTION: ATTRIBUTION}
def __init__(
self,

View File

@ -138,6 +138,8 @@ class TestPicnicSensor(unittest.IsolatedAsyncioTestCase):
if unit:
assert sensor.attributes["unit_of_measurement"] == unit
assert sensor.attributes["attribution"] == "Data provided by Picnic"
async def _setup_platform(
self, use_default_responses=False, enable_all_sensors=True
):