def _update_power_status(self, message=None, status=None):
        """
        Uses the provided message to update the AC power state.

        :param message: message to use to update
        :type message: :py:class:`~alarmdecoder.messages.Message`
        :param status: power status, overrides message bits.
        :type status: bool

        :returns: bool indicating the new status
        """
        power_status = status
        if isinstance(message, Message):
            power_status = message.ac_power

        if power_status is None:
            return

        if power_status != self._power_status:
            self._power_status, old_status = power_status, self._power_status

            if old_status is not None:
                self.on_power_changed(status=self._power_status)

        return self._power_status
def _update_power_status ( self , message = None , status = None ) : power_status = status if isinstance ( message , Message ) : power_status = message . ac_power if power_status is None : return if power_status != self . _power_status : self . _power_status , old_status = power_status , self . _power_status if old_status is not None : self . on_power_changed ( status = self . _power_status ) return self . _power_status
Uses the provided message to update the AC power state.

        :param message: message to use to update
        :type message: :py:class:`~alarmdecoder.messages.Message`
        :param status: power status, overrides message bits.
        :type status: bool

        :returns: bool indicating the new status