pyalarmdotcom / alarmdotcom

Custom component to allow Home Assistant to interface with Alarm.com
MIT License
114 stars 35 forks source link

Arming Without a Code Causes Error After 2024.6 Upgrade #410

Open bumpaneer opened 3 weeks ago

bumpaneer commented 3 weeks ago

After upgrading HA to 2024.6, I was receiving an error trying to alarm my panel without a code.

Seems to be related to: https://github.com/home-assistant/core/issues/118668

The following post helped me in resolving the issue: https://github.com/home-assistant/core/issues/118668#issuecomment-2156059732

I'm not sure if this is the proper fix, but in alarm_control_panel.py around line 65 I added the following to the class definition:

class AlarmControlPanel(HardwareBaseDevice, AlarmControlPanelEntity):  # type: ignore
    """Alarm.com Alarm Control Panel entity."""

    device_type_name: str = "Alarm Control Panel"
    _device: libPartition

    _attr_code_arm_required = False

This allows me to arm my panel correctly as it worked before the update.

TheWebMachine commented 3 weeks ago

I can confirm this is an issue for me, as well. Suddenly all of my security routines began erroring out and it took me all day to figure out why they weren't working.

Going to try the fix mentioned for now.

rmatte commented 3 weeks ago

Seeing the same here. Can't manually arm from the dashboard now either, but can disarm from the dashboard fine. Seems to be related to https://github.com/home-assistant/core/issues/118668 as bumpaneer mentioned.

adamantivm commented 3 weeks ago

I'm on the same boat, thanks for reporting it @bumpaneer

a couple of silly questions to be able to leverage your workaround:

thomasshawn commented 3 weeks ago

I updated the py file and then restarted HA and it worked right away

the only line I needed to add was

_attr_code_arm_required = False

for me to match spacing of the example it was on line 71

adamantivm commented 3 weeks ago

I updated the py file and then restarted HA and it worked right away

the only line I needed to add was

_attr_code_arm_required = False

for me to match spacing of the example it was on line 71

Thanks! Working for me too now. I didn't know it was required to start all of HA to reload integration, TIL.

rmatte commented 3 weeks ago

Is adding _attr_code_arm_required = False the ideal fix for this? If so we should get a PR submitted with that change.

adamyoung3 commented 3 weeks ago

I'm having the same issue. getting this fix published would be appreciated

lbreggi commented 3 weeks ago

This is a new requirement introduced by the update 2024.6. Thank you very much @thomasshawn! You just need to add the line where he mention and reboot HA and everything is working as before again!

rmatte commented 3 weeks ago

PR submitted for this, the package maintainer will need to approve it and cut the new release: https://github.com/pyalarmdotcom/alarmdotcom/pull/413

elahd commented 3 weeks ago

Thanks for this. I’ll merge and release tomorrow (Saturday).

On Fri, Jun 14, 2024 at 3:48 PM Ryan Matte @.***> wrote:

PR submitted for this, the package maintainer will need to approve it and cut the new release: #413 https://github.com/pyalarmdotcom/alarmdotcom/pull/413

— Reply to this email directly, view it on GitHub https://github.com/pyalarmdotcom/alarmdotcom/issues/410#issuecomment-2168661444, or unsubscribe https://github.com/notifications/unsubscribe-auth/AADR4HBCBFIUJD5LCNM27J3ZHNCKPAVCNFSM6AAAAABJBLHBA2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNRYGY3DCNBUGQ . You are receiving this because you are subscribed to this thread.Message ID: @.***>

bkr1969 commented 2 weeks ago

Which py file do we need to add the code part? I haven't found a relevant line 71 spot so far in any of them.

thomasshawn commented 2 weeks ago

/homeassistant/custom_components/alarmdotcom/alarm_control_panel.py

Which py file do we need to add the code part? I haven't found a relevant line 71 spot so far in any of them.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>

rmatte commented 2 weeks ago

Which py file do we need to add the code part? I haven't found a relevant line 71 spot so far in any of them.

You need to edit alarm_control_panel.py and find line number 65 which should be...

class AlarmControlPanel(HardwareBaseDevice, AlarmControlPanelEntity):  # type: ignore

Then find this line under that...

    _device: libPartition

Then add this after it...

     _attr_code_arm_required = False

So that the whole thing looks like...

 class AlarmControlPanel(HardwareBaseDevice, AlarmControlPanelEntity):  # type: ignore
    """Alarm.com Alarm Control Panel entity."""

    device_type_name: str = "Alarm Control Panel"
    _device: libPartition

    _attr_code_arm_required = False

If you installed it via HACS the files for the package will be in your home assistant config directory in a directory called custom_components/alarmdotcom. Once that edit is made, restart home assistant.