1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 12:59:34 +00:00

Fix legacy scrape scan interval (#81764)

* Fix legacy scrape scan interval

* Adjust init

* Adjust tests

* Clearer default
This commit is contained in:
epenet
2022-11-15 13:39:30 +01:00
committed by GitHub
parent 6975186f2f
commit 4cce359960
5 changed files with 20 additions and 17 deletions

View File

@@ -6,7 +6,7 @@ from unittest.mock import patch
import pytest
from homeassistant.components.scrape.sensor import SCAN_INTERVAL
from homeassistant.components.scrape.const import DEFAULT_SCAN_INTERVAL
from homeassistant.components.sensor import (
CONF_STATE_CLASS,
DOMAIN as SENSOR_DOMAIN,
@@ -298,7 +298,7 @@ async def test_scrape_sensor_no_data_refresh(hass: HomeAssistant) -> None:
assert state.state == "Current Version: 2021.12.10"
mocker.payload = "test_scrape_sensor_no_data"
async_fire_time_changed(hass, datetime.utcnow() + SCAN_INTERVAL)
async_fire_time_changed(hass, datetime.utcnow() + DEFAULT_SCAN_INTERVAL)
await hass.async_block_till_done()
state = hass.states.get("sensor.ha_version")