Ravn::Bluez::State::

Pairing class

Request a bluetooth pair with a watch device.

Public Instance Methods

update( * )

In normal operations, attempt to pair to the stored device path - on failure, go back to scanning. If there is a hardcoded watch address in the configuration, we’ll continually attempt to attempt to pair to the device.

# File lib/ravn/bluez/state/pairing.rb, line 19
def update( * )

        # Hardcoded device path.
        #
        if self.device.class.bluetooth_address
                self.device.start_scanning unless Ravn::Bluez.scanning?
                return :is_paired if self.device.pair

        # Regular selection made from the 'scanning' state.'
        #
        else
                return self.device.pair ? :is_paired : :lost_pair
        end
end