home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
73.99k stars 31.04k forks source link

HomeKit fail to create accessory since 2021.8.1 #54124

Closed LordTama closed 3 years ago

LordTama commented 3 years ago

The problem

Since my upgrade to 2021.8.1 HASS fail to create HomeKit accessory for my entry gate.

It’s was fine before in 2021.7.X, I have at least one friend with the same exact issue.

What is version of Home Assistant Core has the issue?

2021.8.1

What was the last working version of Home Assistant Core?

2021.7.X

What type of installation are you running?

Home Assistant OS

Integration causing the issue

homekit

Link to integration documentation on our website

https://www.home-assistant.io/integrations/homekit

Example YAML snippet

No response

Anything in the logs that might be useful for us?

Logger: homeassistant.components.homekit
Source: components/homekit/accessories.py:250 
Integration: HomeKit (documentation, issues) 
First occurred: 8:45:57 (1 occurrences) 
Last logged: 8:45:57

Failed to create a HomeKit accessory for cover.portail
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/homekit/__init__.py", line 628, in add_bridge_accessory
    acc = get_accessory(self.hass, self.driver, state, aid, conf)
  File "/usr/src/homeassistant/homeassistant/components/homekit/accessories.py", line 206, in get_accessory
    return TYPES[a_type](hass, driver, name, state.entity_id, aid, config)
  File "/usr/src/homeassistant/homeassistant/components/homekit/type_covers.py", line 97, in __init__
    super().__init__(*args, category=CATEGORY_GARAGE_DOOR_OPENER)
  File "/usr/src/homeassistant/homeassistant/components/homekit/accessories.py", line 250, in __init__
    firmware_revision=sw_version[:MAX_VERSION_LENGTH],
TypeError: 'NoneType' object is not subscriptable

Additional information

No response

probot-home-assistant[bot] commented 3 years ago

homekit documentation homekit source (message by IssueLinks)

probot-home-assistant[bot] commented 3 years ago

Hey there @bdraco, mind taking a look at this issue as it has been labeled with an integration (homekit) you are listed as a code owner for? Thanks! (message by CodeOwnersMention)

nzapponi commented 3 years ago

I got the same for an accessory of type alarm_control_panel, everything was working fine pre 2021.8:

Logger: homeassistant.components.homekit
Source: components/homekit/accessories.py:248 
Integration: HomeKit (documentation, issues) 
First occurred: 9:34:22 AM (1 occurrences) 
Last logged: 9:34:22 AM

Failed to create a HomeKit accessory for alarm_control_panel.home_alarm
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/homekit/__init__.py", line 628, in add_bridge_accessory
    acc = get_accessory(self.hass, self.driver, state, aid, conf)
  File "/usr/src/homeassistant/homeassistant/components/homekit/accessories.py", line 206, in get_accessory
    return TYPES[a_type](hass, driver, name, state.entity_id, aid, config)
  File "/usr/src/homeassistant/homeassistant/components/homekit/type_security_systems.py", line 87, in __init__
    super().__init__(*args, category=CATEGORY_ALARM_SYSTEM)
  File "/usr/src/homeassistant/homeassistant/components/homekit/accessories.py", line 248, in __init__
    model=model[:MAX_MODEL_LENGTH],
TypeError: 'int' object is not subscriptable
nzapponi commented 3 years ago

Should be an easy fix, submitted a PR which I hope gets merged in ahead of the next patch version

didiermiller commented 3 years ago

Same error here with 2021.8.2:

Logger: homeassistant.components.homekit Source: components/homekit/accessories.py:250 Integration: HomeKit (documentation, issues) First occurred: 11:10:58 AM (5 occurrences) Last logged: 11:10:58 AM

Failed to create a HomeKit accessory for cover.zonnescherm Failed to create a HomeKit accessory for cover.slaapkamer Failed to create a HomeKit accessory for cover.kattenkamer Failed to create a HomeKit accessory for cover.computerkamer Failed to create a HomeKit accessory for cover.keuken Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/homekit/init.py", line 628, in add_bridge_accessory acc = get_accessory(self.hass, self.driver, state, aid, conf) File "/usr/src/homeassistant/homeassistant/components/homekit/accessories.py", line 206, in get_accessory return TYPES[a_type](hass, driver, name, state.entity_id, aid, config) File "/usr/src/homeassistant/homeassistant/components/homekit/type_covers.py", line 348, in init super().init( File "/usr/src/homeassistant/homeassistant/components/homekit/type_covers.py", line 277, in init super().init(args, category=category, service=service) File "/usr/src/homeassistant/homeassistant/components/homekit/type_covers.py", line 205, in init super().init(args, category=category) File "/usr/src/homeassistant/homeassistant/components/homekit/accessories.py", line 250, in init firmware_revision=sw_version[:MAX_VERSION_LENGTH], TypeError: 'NoneType' object is not subscriptable

LordTama commented 3 years ago

Thanks for the fix. We will wait for the review from @bdraco :)

LordTama commented 3 years ago

I confirm the issue is solved since 2021.8.3. Thanks for the quick fix.