nielsfaber / alarmo

Easy to use alarm system integration for Home Assistant
1.37k stars 120 forks source link

Logging Exception Thrown After Disarm #392

Closed D3v01dZA closed 2 years ago

D3v01dZA commented 2 years ago

Alarmo Version

v1.8.4

HA Version

2022.2.3

Bug description

An exception occurs right after the alarm is disarmed because of a format() call being placed on Log.info() instead of the message inside.

Steps to reproduce

Arm the alarm and then disarm it

Relevant log output

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 190, in handle_call_service
    await hass.services.async_call(
  File "/usr/src/homeassistant/homeassistant/core.py", line 1630, in async_call
    task.result()
  File "/usr/src/homeassistant/homeassistant/core.py", line 1667, in _execute_service
    await cast(Callable[[ServiceCall], Awaitable[None]], handler.job.target)(
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 204, in handle_service
    await self.hass.helpers.service.entity_service_call(
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 668, in entity_service_call
    future.result()  # pop exception if have
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 921, in async_request_call
    await coro
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 705, in _handle_entity_call
    await result
  File "/config/custom_components/alarmo/alarm_control_panel.py", line 344, in async_alarm_disarm
    _LOGGER.info("Alarm '{}' is disarmed.").format(self.name)
AttributeError: 'NoneType' object has no attribute 'format'
D3v01dZA commented 2 years ago

Sorry I missed the duplicate issue!