Esempio n. 1
0
Monkey patches commander.SparkCommander to not require an actual connection.
"""

from contextlib import suppress
from copy import deepcopy
from datetime import datetime
from functools import partial
from itertools import count

from aiohttp import web
from brewblox_service import brewblox_logger, features

from brewblox_devcon_spark import (codec, commander, commands, const,
                                   exceptions, service_status)

LOGGER = brewblox_logger(__name__)


def make_device(app: web.Application):
    config = app['config']
    ini = app['ini']

    return service_status.DeviceInfo(
        firmware_version=ini['firmware_version'],
        proto_version=ini['proto_version'],
        firmware_date=ini['firmware_date'],
        proto_date=ini['proto_date'],
        device_id=config['device_id'],
        system_version='sys_version',
        platform='Simulator',
        reset_reason='Simulator reset',
Esempio n. 2
0
Brewblox service for Tilt hydrometer
"""
import asyncio
import csv
import os.path
import time

import bluetooth._bluetooth as bluez
import numpy as np
from aiohttp import web
from brewblox_service import brewblox_logger, features, mqtt, repeater, strex
from pint import UnitRegistry

from . import blescan

LOGGER = brewblox_logger("brewblox_tilt")
ureg = UnitRegistry()
Q_ = ureg.Quantity

IDS = {
    "a495bb10c5b14b44b5121370f02d74de": "Red",
    "a495bb20c5b14b44b5121370f02d74de": "Green",
    "a495bb30c5b14b44b5121370f02d74de": "Black",
    "a495bb40c5b14b44b5121370f02d74de": "Purple",
    "a495bb50c5b14b44b5121370f02d74de": "Orange",
    "a495bb60c5b14b44b5121370f02d74de": "Blue",
    "a495bb70c5b14b44b5121370f02d74de": "Yellow",
    "a495bb80c5b14b44b5121370f02d74de": "Pink"
}

SG_CAL_FILE_PATH = "/share/SGCal.csv"