Test session starts (platform: darwin, Python 3.10.8, pytest 7.2.0, pytest-sugar 0.9.5)
rootdir: /Users/jon/Downloads/my-integration_blueprint, configfile: pyproject.toml, testpaths: tests
plugins: asyncio-0.20.2, xdist-2.5.0, freezegun-0.4.2, forked-1.4.0, sugar-0.9.5, timeout-2.1.0, requests-mock-1.10.0, respx-0.20.1, socket-0.5.1, anyio-3.6.2, test-groups-1.0.3, cov-3.0.0, aiohttp-1.0.4, homeassistant-custom-component-0.12.29
asyncio: mode=strict
collecting ...
tests/test_api.py ✓ 14% █▌
tests/test_config_flow.py ✓✓✓ 57% █████▊ INFO:homeassistant.loader:Loaded integration_blueprint from custom_components.integration_blueprint
WARNING:homeassistant.loader:We found a custom integration integration_blueprint which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
tests/test_init.py ✓✓ 86% ████████▋
――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― test_switch_services ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――
hass = <homeassistant.core.HomeAssistant object at 0x140b4d6f0>
@pytest.mark.asyncio
async def test_switch_services(hass):
"""Test switch services."""
# Create a mock entry so we don't have to go through config flow
config_entry = MockConfigEntry(domain=DOMAIN, data=MOCK_CONFIG, entry_id="test")
assert await async_setup_entry(hass, config_entry)
await hass.async_block_till_done()
# Functions/objects can be patched directly in test code as well and can be used to test
# additional things, like whether a function was called or what arguments it was called with
with patch(
"custom_components.integration_blueprint.IntegrationBlueprintApiClient.async_set_title"
) as title_func:
> await hass.services.async_call(
SWITCH,
SERVICE_TURN_OFF,
service_data={ATTR_ENTITY_ID: f"{SWITCH}.{DEFAULT_NAME}_{SWITCH}"},
blocking=True,
)
tests/test_switch.py:28:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
../../Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/core.py:1745: in async_call
task.result()
../../Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/core.py:1782: in _execute_service
await cast(Callable[[ServiceCall], Awaitable[None]], handler.job.target)(
../../Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity_component.py:213: in handle_service
await service.entity_service_call(
../../Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/service.py:678: in entity_service_call
future.result() # pop exception if have
../../Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity.py:943: in async_request_call
await coro
../../Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/service.py:715: in _handle_entity_call
await result
custom_components/integration_blueprint/switch.py:25: in async_turn_off
await self.coordinator.async_request_refresh()
../../Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/update_coordinator.py:175: in async_request_refresh
await self._debounced_refresh.async_call()
../../Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/debounce.py:82: in async_call
await task
../../Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/update_coordinator.py:201: in async_refresh
await self._async_refresh(log_failures=True)
../../Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/update_coordinator.py:316: in _async_refresh
self.async_update_listeners()
../../Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/update_coordinator.py:121: in async_update_listeners
update_callback()
../../Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/update_coordinator.py:381: in _handle_coordinator_update
self.async_write_ha_state()
../../Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity.py:545: in async_write_ha_state
self._async_write_ha_state()
../../Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity.py:583: in _async_write_ha_state
state = self._stringify_state(available)
../../Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity.py:551: in _stringify_state
if (state := self.state) is None:
../../Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity.py:982: in state
if (is_on := self.is_on) is None:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <[AttributeError("'NoneType' object has no attribute 'get'") raised in repr()] IntegrationBlueprintBinarySwitch object at 0x140bf1c90>
@property
def is_on(self):
"""Return true if the switch is on."""
> return self.coordinator.data.get("title", "") == "foo"
E AttributeError: 'NoneType' object has no attribute 'get'
custom_components/integration_blueprint/switch.py:40: AttributeError
--------------------------------------------------------------------------------------- Captured stderr setup ---------------------------------------------------------------------------------------
DEBUG:asyncio:Using selector: KqueueSelector
---------------------------------------------------------------------------------------- Captured log setup -----------------------------------------------------------------------------------------
DEBUG asyncio:selector_events.py:54 Using selector: KqueueSelector
--------------------------------------------------------------------------------------- Captured stderr call ----------------------------------------------------------------------------------------
INFO:custom_components.integration_blueprint:
-------------------------------------------------------------------
Integration blueprint
Version: 0.0.1
This is a custom integration!
If you have any issues with this you need to open an issue here:
https://github.com/custom-components/integration_blueprint/issues
-------------------------------------------------------------------
ERROR:custom_components.integration_blueprint:Something really wrong happened! - A test tried to use socket.socket.
DEBUG:custom_components.integration_blueprint:Finished fetching integration_blueprint data in 0.004 seconds (success: True)
INFO:homeassistant.loader:Loaded integration_blueprint from custom_components.integration_blueprint
WARNING:homeassistant.loader:We found a custom integration integration_blueprint which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
INFO:homeassistant.loader:Loaded switch from homeassistant.components.switch
INFO:homeassistant.loader:Loaded sensor from homeassistant.components.sensor
INFO:homeassistant.loader:Loaded binary_sensor from homeassistant.components.binary_sensor
INFO:homeassistant.setup:Setting up switch
DEBUG:homeassistant.core:Bus:Handling <Event service_registered[L]: domain=switch, service=turn_off>
DEBUG:homeassistant.core:Bus:Handling <Event service_registered[L]: domain=switch, service=turn_on>
DEBUG:homeassistant.core:Bus:Handling <Event service_registered[L]: domain=switch, service=toggle>
INFO:homeassistant.setup:Setup of domain switch took 0.0 seconds
DEBUG:homeassistant.core:Bus:Handling <Event component_loaded[L]: component=switch>
INFO:homeassistant.setup:Setting up sensor
INFO:homeassistant.setup:Setup of domain sensor took 0.0 seconds
INFO:homeassistant.setup:Setting up binary_sensor
INFO:homeassistant.setup:Setup of domain binary_sensor took 0.0 seconds
DEBUG:homeassistant.core:Bus:Handling <Event component_loaded[L]: component=sensor>
DEBUG:homeassistant.core:Bus:Handling <Event component_loaded[L]: component=binary_sensor>
INFO:homeassistant.setup:Setting up integration_blueprint
INFO:homeassistant.setup:Setup of domain integration_blueprint took 0.0 seconds
DEBUG:homeassistant.core:Bus:Handling <Event component_loaded[L]: component=integration_blueprint>
INFO:homeassistant.components.switch:Setting up switch.integration_blueprint
INFO:homeassistant.components.sensor:Setting up sensor.integration_blueprint
INFO:homeassistant.components.binary_sensor:Setting up binary_sensor.integration_blueprint
DEBUG:homeassistant.core:Bus:Handling <Event device_registry_updated[L]: action=create, device_id=543c5a236800f9a6cd0362c2228cce09>
INFO:homeassistant.helpers.entity_registry:Registered new switch.integration_blueprint entity: switch.integration_blueprint_switch
DEBUG:homeassistant.core:Bus:Handling <Event entity_registry_updated[L]: action=create, entity_id=switch.integration_blueprint_switch>
INFO:homeassistant.helpers.entity_registry:Registered new sensor.integration_blueprint entity: sensor.integration_blueprint_sensor
DEBUG:homeassistant.core:Bus:Handling <Event entity_registry_updated[L]: action=create, entity_id=sensor.integration_blueprint_sensor>
INFO:homeassistant.helpers.entity_registry:Registered new binary_sensor.integration_blueprint entity: binary_sensor.integration_blueprint_binary_sensor
DEBUG:homeassistant.core:Bus:Handling <Event entity_registry_updated[L]: action=create, entity_id=binary_sensor.integration_blueprint_binary_sensor>
ERROR:homeassistant.components.switch:Error adding entities for domain switch with platform integration_blueprint
Traceback (most recent call last):
File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity_platform.py", line 428, in async_add_entities
await asyncio.gather(*tasks)
File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity_platform.py", line 692, in _async_add_entity
await entity.add_to_platform_finish()
File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity.py", line 789, in add_to_platform_finish
self.async_write_ha_state()
File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity.py", line 545, in async_write_ha_state
self._async_write_ha_state()
File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity.py", line 583, in _async_write_ha_state
state = self._stringify_state(available)
File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity.py", line 551, in _stringify_state
if (state := self.state) is None:
File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity.py", line 982, in state
if (is_on := self.is_on) is None:
File "/Users/jon/Downloads/my-integration_blueprint/custom_components/integration_blueprint/switch.py", line 40, in is_on
return self.coordinator.data.get("title", "") == "foo"
AttributeError: 'NoneType' object has no attribute 'get'
ERROR:homeassistant.components.sensor:Error adding entities for domain sensor with platform integration_blueprint
Traceback (most recent call last):
File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity_platform.py", line 428, in async_add_entities
await asyncio.gather(*tasks)
File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity_platform.py", line 692, in _async_add_entity
await entity.add_to_platform_finish()
File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity.py", line 789, in add_to_platform_finish
self.async_write_ha_state()
File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity.py", line 545, in async_write_ha_state
self._async_write_ha_state()
File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity.py", line 583, in _async_write_ha_state
state = self._stringify_state(available)
File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity.py", line 551, in _stringify_state
if (state := self.state) is None:
File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/components/sensor/__init__.py", line 680, in state
value = self.native_value
File "/Users/jon/Downloads/my-integration_blueprint/custom_components/integration_blueprint/sensor.py", line 25, in native_value
return self.coordinator.data.get("body")
AttributeError: 'NoneType' object has no attribute 'get'
ERROR:homeassistant.components.binary_sensor:Error adding entities for domain binary_sensor with platform integration_blueprint
Traceback (most recent call last):
File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity_platform.py", line 428, in async_add_entities
await asyncio.gather(*tasks)
File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity_platform.py", line 692, in _async_add_entity
await entity.add_to_platform_finish()
File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity.py", line 789, in add_to_platform_finish
self.async_write_ha_state()
File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity.py", line 545, in async_write_ha_state
self._async_write_ha_state()
File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity.py", line 583, in _async_write_ha_state
state = self._stringify_state(available)
File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity.py", line 551, in _stringify_state
if (state := self.state) is None:
File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/components/binary_sensor/__init__.py", line 211, in state
if (is_on := self.is_on) is None:
File "/Users/jon/Downloads/my-integration_blueprint/custom_components/integration_blueprint/binary_sensor.py", line 35, in is_on
return self.coordinator.data.get("title", "") == "foo"
AttributeError: 'NoneType' object has no attribute 'get'
ERROR:homeassistant.components.switch:Error while setting up integration_blueprint platform for switch
Traceback (most recent call last):
File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity_platform.py", line 289, in _async_setup_platform
await asyncio.gather(*pending)
File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity_platform.py", line 428, in async_add_entities
await asyncio.gather(*tasks)
File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity_platform.py", line 692, in _async_add_entity
await entity.add_to_platform_finish()
File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity.py", line 789, in add_to_platform_finish
self.async_write_ha_state()
File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity.py", line 545, in async_write_ha_state
self._async_write_ha_state()
File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity.py", line 583, in _async_write_ha_state
state = self._stringify_state(available)
File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity.py", line 551, in _stringify_state
if (state := self.state) is None:
File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity.py", line 982, in state
if (is_on := self.is_on) is None:
File "/Users/jon/Downloads/my-integration_blueprint/custom_components/integration_blueprint/switch.py", line 40, in is_on
return self.coordinator.data.get("title", "") == "foo"
AttributeError: 'NoneType' object has no attribute 'get'
ERROR:homeassistant.components.sensor:Error while setting up integration_blueprint platform for sensor
Traceback (most recent call last):
File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity_platform.py", line 289, in _async_setup_platform
await asyncio.gather(*pending)
File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity_platform.py", line 428, in async_add_entities
await asyncio.gather(*tasks)
File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity_platform.py", line 692, in _async_add_entity
await entity.add_to_platform_finish()
File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity.py", line 789, in add_to_platform_finish
self.async_write_ha_state()
File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity.py", line 545, in async_write_ha_state
self._async_write_ha_state()
File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity.py", line 583, in _async_write_ha_state
state = self._stringify_state(available)
File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity.py", line 551, in _stringify_state
if (state := self.state) is None:
File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/components/sensor/__init__.py", line 680, in state
value = self.native_value
File "/Users/jon/Downloads/my-integration_blueprint/custom_components/integration_blueprint/sensor.py", line 25, in native_value
return self.coordinator.data.get("body")
AttributeError: 'NoneType' object has no attribute 'get'
ERROR:homeassistant.components.binary_sensor:Error while setting up integration_blueprint platform for binary_sensor
Traceback (most recent call last):
File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity_platform.py", line 289, in _async_setup_platform
await asyncio.gather(*pending)
File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity_platform.py", line 428, in async_add_entities
await asyncio.gather(*tasks)
File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity_platform.py", line 692, in _async_add_entity
await entity.add_to_platform_finish()
File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity.py", line 789, in add_to_platform_finish
self.async_write_ha_state()
File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity.py", line 545, in async_write_ha_state
self._async_write_ha_state()
File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity.py", line 583, in _async_write_ha_state
state = self._stringify_state(available)
File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity.py", line 551, in _stringify_state
if (state := self.state) is None:
File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/components/binary_sensor/__init__.py", line 211, in state
if (is_on := self.is_on) is None:
File "/Users/jon/Downloads/my-integration_blueprint/custom_components/integration_blueprint/binary_sensor.py", line 35, in is_on
return self.coordinator.data.get("title", "") == "foo"
AttributeError: 'NoneType' object has no attribute 'get'
DEBUG:homeassistant.core:Bus:Handling <Event call_service[L]: domain=switch, service=turn_off, service_data=entity_id=switch.integration_blueprint_switch>
ERROR:custom_components.integration_blueprint:Something really wrong happened! - A test tried to use socket.socket.
DEBUG:custom_components.integration_blueprint:Finished fetching integration_blueprint data in 0.000 seconds (success: True)
----------------------------------------------------------------------------------------- Captured log call -----------------------------------------------------------------------------------------
INFO custom_components.integration_blueprint:__init__.py:41
-------------------------------------------------------------------
Integration blueprint
Version: 0.0.1
This is a custom integration!
If you have any issues with this you need to open an issue here:
https://github.com/custom-components/integration_blueprint/issues
-------------------------------------------------------------------
ERROR custom_components.integration_blueprint:api.py:75 Something really wrong happened! - A test tried to use socket.socket.
DEBUG custom_components.integration_blueprint:update_coordinator.py:307 Finished fetching integration_blueprint data in 0.004 seconds (success: True)
INFO homeassistant.loader:loader.py:543 Loaded integration_blueprint from custom_components.integration_blueprint
WARNING homeassistant.loader:loader.py:489 We found a custom integration integration_blueprint which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
INFO homeassistant.loader:loader.py:543 Loaded switch from homeassistant.components.switch
INFO homeassistant.loader:loader.py:543 Loaded sensor from homeassistant.components.sensor
INFO homeassistant.loader:loader.py:543 Loaded binary_sensor from homeassistant.components.binary_sensor
INFO homeassistant.setup:setup.py:222 Setting up switch
DEBUG homeassistant.core:core.py:914 Bus:Handling <Event service_registered[L]: domain=switch, service=turn_off>
DEBUG homeassistant.core:core.py:914 Bus:Handling <Event service_registered[L]: domain=switch, service=turn_on>
DEBUG homeassistant.core:core.py:914 Bus:Handling <Event service_registered[L]: domain=switch, service=toggle>
INFO homeassistant.setup:setup.py:270 Setup of domain switch took 0.0 seconds
DEBUG homeassistant.core:core.py:914 Bus:Handling <Event component_loaded[L]: component=switch>
INFO homeassistant.setup:setup.py:222 Setting up sensor
INFO homeassistant.setup:setup.py:270 Setup of domain sensor took 0.0 seconds
INFO homeassistant.setup:setup.py:222 Setting up binary_sensor
INFO homeassistant.setup:setup.py:270 Setup of domain binary_sensor took 0.0 seconds
DEBUG homeassistant.core:core.py:914 Bus:Handling <Event component_loaded[L]: component=sensor>
DEBUG homeassistant.core:core.py:914 Bus:Handling <Event component_loaded[L]: component=binary_sensor>
INFO homeassistant.setup:setup.py:222 Setting up integration_blueprint
INFO homeassistant.setup:setup.py:270 Setup of domain integration_blueprint took 0.0 seconds
DEBUG homeassistant.core:core.py:914 Bus:Handling <Event component_loaded[L]: component=integration_blueprint>
INFO homeassistant.components.switch:entity_platform.py:267 Setting up switch.integration_blueprint
INFO homeassistant.components.sensor:entity_platform.py:267 Setting up sensor.integration_blueprint
INFO homeassistant.components.binary_sensor:entity_platform.py:267 Setting up binary_sensor.integration_blueprint
DEBUG homeassistant.core:core.py:914 Bus:Handling <Event device_registry_updated[L]: action=create, device_id=543c5a236800f9a6cd0362c2228cce09>
INFO homeassistant.helpers.entity_registry:entity_registry.py:494 Registered new switch.integration_blueprint entity: switch.integration_blueprint_switch
DEBUG homeassistant.core:core.py:914 Bus:Handling <Event entity_registry_updated[L]: action=create, entity_id=switch.integration_blueprint_switch>
INFO homeassistant.helpers.entity_registry:entity_registry.py:494 Registered new sensor.integration_blueprint entity: sensor.integration_blueprint_sensor
DEBUG homeassistant.core:core.py:914 Bus:Handling <Event entity_registry_updated[L]: action=create, entity_id=sensor.integration_blueprint_sensor>
INFO homeassistant.helpers.entity_registry:entity_registry.py:494 Registered new binary_sensor.integration_blueprint entity: binary_sensor.integration_blueprint_binary_sensor
DEBUG homeassistant.core:core.py:914 Bus:Handling <Event entity_registry_updated[L]: action=create, entity_id=binary_sensor.integration_blueprint_binary_sensor>
ERROR homeassistant.components.switch:entity_platform.py:437 Error adding entities for domain switch with platform integration_blueprint
Traceback (most recent call last):
File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity_platform.py", line 428, in async_add_entities
await asyncio.gather(*tasks)
File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity_platform.py", line 692, in _async_add_entity
await entity.add_to_platform_finish()
File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity.py", line 789, in add_to_platform_finish
self.async_write_ha_state()
File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity.py", line 545, in async_write_ha_state
self._async_write_ha_state()
File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity.py", line 583, in _async_write_ha_state
state = self._stringify_state(available)
File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity.py", line 551, in _stringify_state
if (state := self.state) is None:
File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity.py", line 982, in state
if (is_on := self.is_on) is None:
File "/Users/jon/Downloads/my-integration_blueprint/custom_components/integration_blueprint/switch.py", line 40, in is_on
return self.coordinator.data.get("title", "") == "foo"
AttributeError: 'NoneType' object has no attribute 'get'
ERROR homeassistant.components.sensor:entity_platform.py:437 Error adding entities for domain sensor with platform integration_blueprint
Traceback (most recent call last):
File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity_platform.py", line 428, in async_add_entities
await asyncio.gather(*tasks)
File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity_platform.py", line 692, in _async_add_entity
await entity.add_to_platform_finish()
File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity.py", line 789, in add_to_platform_finish
self.async_write_ha_state()
File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity.py", line 545, in async_write_ha_state
self._async_write_ha_state()
File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity.py", line 583, in _async_write_ha_state
state = self._stringify_state(available)
File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity.py", line 551, in _stringify_state
if (state := self.state) is None:
File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/components/sensor/__init__.py", line 680, in state
value = self.native_value
File "/Users/jon/Downloads/my-integration_blueprint/custom_components/integration_blueprint/sensor.py", line 25, in native_value
return self.coordinator.data.get("body")
AttributeError: 'NoneType' object has no attribute 'get'
ERROR homeassistant.components.binary_sensor:entity_platform.py:437 Error adding entities for domain binary_sensor with platform integration_blueprint
Traceback (most recent call last):
File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity_platform.py", line 428, in async_add_entities
await asyncio.gather(*tasks)
File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity_platform.py", line 692, in _async_add_entity
await entity.add_to_platform_finish()
File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity.py", line 789, in add_to_platform_finish
self.async_write_ha_state()
File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity.py", line 545, in async_write_ha_state
self._async_write_ha_state()
File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity.py", line 583, in _async_write_ha_state
state = self._stringify_state(available)
File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity.py", line 551, in _stringify_state
if (state := self.state) is None:
File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/components/binary_sensor/__init__.py", line 211, in state
if (is_on := self.is_on) is None:
File "/Users/jon/Downloads/my-integration_blueprint/custom_components/integration_blueprint/binary_sensor.py", line 35, in is_on
return self.coordinator.data.get("title", "") == "foo"
AttributeError: 'NoneType' object has no attribute 'get'
ERROR homeassistant.components.switch:entity_platform.py:337 Error while setting up integration_blueprint platform for switch
Traceback (most recent call last):
File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity_platform.py", line 289, in _async_setup_platform
await asyncio.gather(*pending)
File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity_platform.py", line 428, in async_add_entities
await asyncio.gather(*tasks)
File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity_platform.py", line 692, in _async_add_entity
await entity.add_to_platform_finish()
File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity.py", line 789, in add_to_platform_finish
self.async_write_ha_state()
File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity.py", line 545, in async_write_ha_state
self._async_write_ha_state()
File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity.py", line 583, in _async_write_ha_state
state = self._stringify_state(available)
File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity.py", line 551, in _stringify_state
if (state := self.state) is None:
File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity.py", line 982, in state
if (is_on := self.is_on) is None:
File "/Users/jon/Downloads/my-integration_blueprint/custom_components/integration_blueprint/switch.py", line 40, in is_on
return self.coordinator.data.get("title", "") == "foo"
AttributeError: 'NoneType' object has no attribute 'get'
ERROR homeassistant.components.sensor:entity_platform.py:337 Error while setting up integration_blueprint platform for sensor
Traceback (most recent call last):
File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity_platform.py", line 289, in _async_setup_platform
await asyncio.gather(*pending)
File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity_platform.py", line 428, in async_add_entities
await asyncio.gather(*tasks)
File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity_platform.py", line 692, in _async_add_entity
await entity.add_to_platform_finish()
File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity.py", line 789, in add_to_platform_finish
self.async_write_ha_state()
File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity.py", line 545, in async_write_ha_state
self._async_write_ha_state()
File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity.py", line 583, in _async_write_ha_state
state = self._stringify_state(available)
File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity.py", line 551, in _stringify_state
if (state := self.state) is None:
File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/components/sensor/__init__.py", line 680, in state
value = self.native_value
File "/Users/jon/Downloads/my-integration_blueprint/custom_components/integration_blueprint/sensor.py", line 25, in native_value
return self.coordinator.data.get("body")
AttributeError: 'NoneType' object has no attribute 'get'
ERROR homeassistant.components.binary_sensor:entity_platform.py:337 Error while setting up integration_blueprint platform for binary_sensor
Traceback (most recent call last):
File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity_platform.py", line 289, in _async_setup_platform
await asyncio.gather(*pending)
File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity_platform.py", line 428, in async_add_entities
await asyncio.gather(*tasks)
File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity_platform.py", line 692, in _async_add_entity
await entity.add_to_platform_finish()
File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity.py", line 789, in add_to_platform_finish
self.async_write_ha_state()
File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity.py", line 545, in async_write_ha_state
self._async_write_ha_state()
File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity.py", line 583, in _async_write_ha_state
state = self._stringify_state(available)
File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity.py", line 551, in _stringify_state
if (state := self.state) is None:
File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/components/binary_sensor/__init__.py", line 211, in state
if (is_on := self.is_on) is None:
File "/Users/jon/Downloads/my-integration_blueprint/custom_components/integration_blueprint/binary_sensor.py", line 35, in is_on
return self.coordinator.data.get("title", "") == "foo"
AttributeError: 'NoneType' object has no attribute 'get'
DEBUG homeassistant.core:core.py:914 Bus:Handling <Event call_service[L]: domain=switch, service=turn_off, service_data=entity_id=switch.integration_blueprint_switch>
ERROR custom_components.integration_blueprint:api.py:75 Something really wrong happened! - A test tried to use socket.socket.
DEBUG custom_components.integration_blueprint:update_coordinator.py:307 Finished fetching integration_blueprint data in 0.000 seconds (success: True)
tests/test_switch.py ⨯ 100% ██████████
========================================================================================= warnings summary ==========================================================================================
tests/test_switch.py::test_switch_services
/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/pytest_homeassistant_custom_component/plugins.py:226: UserWarning: Lingering timer after test <TimerHandle when=762553.8618564156 async_track_point_in_utc_time.<locals>.run_action(<Job HassJobT...0x140bf3c40>>>) at /Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/event.py:1305>
warnings.warn(f"Lingering timer after test {handle}")
-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
====================================================================================== short test summary info ======================================================================================
FAILED tests/test_switch.py::test_switch_services - AttributeError: 'NoneType' object has no attribute 'get'
Results (0.36s):
6 passed
1 failed