Giter Site home page Giter Site logo

pin code is a bit funky about sector HOT 4 CLOSED

gjohansson-st avatar gjohansson-st commented on September 27, 2024
pin code is a bit funky

from sector.

Comments (4)

gjohansson-ST avatar gjohansson-ST commented on September 27, 2024

Sorry for a late reply but I will change the code so one can choose to use a pin or not to arm/disarm. Will come back

from sector.

dogmatic69 avatar dogmatic69 commented on September 27, 2024

I changed it like this and works ok. Idea is that there is no need for a code to lock (that is how the control panel works, you just press arm home / away).

To disarm it requires a code, but will use whatever is entered. If the code is wrong sector will handle it.


    async def async_alarm_arm_home(self, code=None):
        _LOGGER.debug("Trying to arm home Sector Alarm")
        result = await self._hub.triggeralarm("partial", code=(code or self._code))
        if result:
            _LOGGER.debug("Armed home")
            self._state = STATE_ALARM_ARMED_HOME
            await self.coordinator.async_refresh()

    async def async_alarm_disarm(self, code=None):
        _LOGGER.debug("Trying to disarm")
        result = await self._hub.triggeralarm("disarm", code=code)
        if result:
            _LOGGER.debug("Disarmed Sector Alarm")
            self._state = STATE_ALARM_DISARMED
            await self.coordinator.async_refresh()

    async def async_alarm_arm_away(self, code=None):
        _LOGGER.debug("Trying to arm away")
        result = await self._hub.triggeralarm("full", code=(code or self._code))
        if result:
            _LOGGER.debug("Armed away Sector Alarm")
            self._state = STATE_ALARM_ARMED_AWAY
            await self.coordinator.async_refresh()

from sector.

dogmatic69 avatar dogmatic69 commented on September 27, 2024

Updated to beta16 and I've configured with the code but disarming now works without a code. IMO it should be possible to arm without a code but disarm should explicitly requite entering the pin.

from sector.

gjohansson-ST avatar gjohansson-ST commented on September 27, 2024

I decided to go for on or off on this one so if a code is supplied in config options then arming/disarming can be without code supplied.
Likewise if no code is set in options a code needs to be supplied every time.

Everyone is going to want different so feel free to alter the code for your fit as with your example above.

from sector.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.