diff --git a/homeassistant/components/demo.py b/homeassistant/components/demo.py index b85c2d9a53b..64ce3cda073 100644 --- a/homeassistant/components/demo.py +++ b/homeassistant/components/demo.py @@ -118,6 +118,17 @@ def async_setup(hass, config): tasks2 = [] + # Set up history graph + tasks2.append(bootstrap.async_setup_component( + hass, 'history_graph', + {'history_graph': {'switches': { + 'name': 'Recent Switches', + 'entities': switches, + 'hours_to_show': 1, + 'refresh': 60 + }}} + )) + # Set up scripts tasks2.append(bootstrap.async_setup_component( hass, 'script', diff --git a/tests/components/test_demo.py b/tests/components/test_demo.py index 93aac65ecb5..258e3d96297 100644 --- a/tests/components/test_demo.py +++ b/tests/components/test_demo.py @@ -10,6 +10,12 @@ from homeassistant.components import demo, device_tracker from homeassistant.remote import JSONEncoder +@pytest.fixture(autouse=True) +def mock_history(hass): + """Mock history component loaded.""" + hass.config.components.add('history') + + @pytest.fixture def minimize_demo_platforms(hass): """Cleanup demo component for tests."""