"""
Get all BLE device broadcasts
"""

from ruuvitag_sensor.ble_communication import BleCommunicationNix
import ruuvitag_sensor.log

ruuvitag_sensor.log.enable_console()

ble = BleCommunicationNix()

for ble_data in ble.get_datas():
    print(ble_data)
Example #2
0
import sys
import os
import time
import logging

from ruuvitag_sensor.decoder import get_decoder

log = logging.getLogger(__name__)

if not sys.platform.startswith('linux') or os.environ.get('CI') == 'True':
    # Use BleCommunicationDummy also for CI as it can't use bluez
    from ruuvitag_sensor.ble_communication import BleCommunicationDummy
    ble = BleCommunicationDummy()
else:
    from ruuvitag_sensor.ble_communication import BleCommunicationNix
    ble = BleCommunicationNix()


class RunFlag(object):
    """
    Wrapper for boolean run flag

    Attributes:
        running (bool): Defines if function should continue execution
    """

    running = True


class RuuviTagSensor(object):
    """