palazzem / ha-econnect-alarm

Home Assistant integration that provides a full-fledged Alarm Panel to control your Elmo/IESS alarm systems.
BSD 3-Clause "New" or "Revised" License
10 stars 5 forks source link

feat: add arm/disarm sectors services to activate/deactivate a selection of sectors #144

Closed palazzem closed 4 months ago

palazzem commented 4 months ago

Related Issues

n/a

Proposed Changes:

Implements arm_sectors and disarm_sectors services that can be used to enable a single sector or a list of sectors. The change includes an internal mapping between sectors entity ids and the actual sector ID in the e-Connect backend API. While this change is not expected to stay, it is currently required as Home Assistant doesn't provide a way to easily access entities (see https://github.com/palazzem/ha-econnect-alarm/commit/b16d1190771ccef5b301cf11bab75329d7057ce2#diff-9228969e4ac379606b6ced4a4f29bcacc8c5cf55b2a94c47721038593dab9557R11-R23).

Testing:

Open the developer console and simply activate/deactivate sectors (or use it within automations).

Extra Notes (optional):

A refactoring of AlarmDevice is required regardless, so we don't need to overcomplicate this implementation as interfaces will change eventually.

Checklist

coveralls commented 4 months ago

Pull Request Test Coverage Report for Build 7942471583

Details


Changes Missing Coverage Covered Lines Changed/Added Lines %
custom_components/econnect_metronet/init.py 2 4 50.0%
<!-- Total: 29 31 93.55% -->
Totals Coverage Status
Change from base Build 7935781714: 0.01%
Covered Lines: 651
Relevant Lines: 697

💛 - Coveralls