├── .editorconfig ├── .github ├── dependabot.yml └── workflows │ └── ci.yml ├── .gitignore ├── .pylintrc ├── .style.yapf ├── LICENSE ├── Makefile ├── README.md ├── bme280 ├── __init__.py └── bme280.py ├── demo.py ├── pyproject.toml └── tests ├── __init__.py ├── bme280_test.py └── snapshots ├── __init__.py └── snap_bme280_test.py /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | indent_style = space 5 | indent_size = 4 6 | end_of_line = lf 7 | charset = utf-8 8 | trim_trailing_whitespace = true 9 | insert_final_newline = true 10 | 11 | [*.yml] 12 | indent_size = 2 13 | 14 | [Makefile] 15 | indent_style = tab 16 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | --- 2 | version: 2 3 | updates: 4 | - package-ecosystem: pip 5 | directory: "/" 6 | schedule: 7 | interval: weekly 8 | day: thursday 9 | time: '14:00' 10 | timezone: Europe/Berlin 11 | pull-request-branch-name: 12 | separator: "-" 13 | open-pull-requests-limit: 99 14 | commit-message: 15 | prefix: "module:" 16 | target-branch: three 17 | versioning-strategy: lockfile-only 18 | allow: 19 | - dependency-type: direct 20 | - dependency-type: indirect 21 | - package-ecosystem: pip 22 | directory: "/" 23 | schedule: 24 | interval: weekly 25 | day: thursday 26 | time: '14:00' 27 | timezone: Europe/Berlin 28 | pull-request-branch-name: 29 | separator: "-" 30 | open-pull-requests-limit: 99 31 | commit-message: 32 | prefix: "module:" 33 | versioning-strategy: lockfile-only 34 | allow: 35 | - dependency-type: direct 36 | - dependency-type: indirect 37 | -------------------------------------------------------------------------------- /.github/workflows/ci.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: ci 3 | 4 | on: 5 | push: 6 | branches: [master] 7 | pull_request: 8 | branches: [master] 9 | workflow_dispatch: 10 | #schedule: 11 | #- cron: '41 4 * * 4' # weekly on thursday morning 12 | 13 | jobs: 14 | build: 15 | runs-on: ubuntu-22.04 16 | strategy: 17 | fail-fast: false 18 | matrix: 19 | python-version: 20 | - '3.7' 21 | - '3.9' 22 | - '3.10' 23 | - '3.11' 24 | steps: 25 | - uses: actions/checkout@v3 26 | - run: python -m pip install --upgrade pip 27 | - name: Set up Python ${{ matrix.python-version }} 28 | uses: actions/setup-python@v4 29 | with: 30 | python-version: ${{ matrix.python-version }} 31 | - name: Install Poetry 32 | run: | 33 | curl -sSL "https://install.python-poetry.org" | python3 - 34 | - name: Install dependencies 35 | run: | 36 | poetry install 37 | - name: Lint 38 | run: | 39 | make lint 40 | - name: Test 41 | run: | 42 | make test 43 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .pytest_cache/ 2 | __pycache__/ 3 | *.egg-info/ 4 | *.py[cod] 5 | poetry.lock 6 | -------------------------------------------------------------------------------- /.pylintrc: -------------------------------------------------------------------------------- 1 | [DESIGN] 2 | max-attributes=11 3 | max-public-methods=25 4 | 5 | [FORMAT] 6 | max-line-length=121 7 | 8 | [MESSAGES CONTROL] 9 | disable=invalid-name,missing-docstring 10 | -------------------------------------------------------------------------------- /.style.yapf: -------------------------------------------------------------------------------- 1 | [style] 2 | based_on_style = pep8 3 | column_limit = 120 4 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 Christian Nicolai 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | 2 | # https://tech.davis-hansson.com/p/make/ 3 | SHELL := bash 4 | .ONESHELL: 5 | .SHELLFLAGS := -eux -o pipefail -c 6 | .DELETE_ON_ERROR: 7 | .SILENT: 8 | .DEFAULT_GOAL := all 9 | MAKEFLAGS += --warn-undefined-variables 10 | MAKEFLAGS += --no-builtin-rules 11 | 12 | .PHONY: all 13 | all: lint test ## Run lint and test (default goal) 14 | 15 | .PHONY: lint 16 | lint: ## Lint all source code 17 | poetry run yapf -q -r bme280 18 | poetry run pylint --ignore=snapshots bme280 tests 19 | 20 | .PHONY: test 21 | test: ## Run all tests 22 | poetry run pytest 23 | 24 | .PHONY: help 25 | help: ## Print this help text 26 | @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-15s\033[0m %s\n", $$1, $$2}' 27 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # python-bme280 2 | 3 | ![ci](https://github.com/cmur2/python-bme280/workflows/ci/badge.svg?branch=master) 4 | 5 | A Python library for accessing the [BME280 combined humidity and pressure](https://ae-bst.resource.bosch.com/media/_tech/media/datasheets/BST-BME280_DS001-11.pdf) from Bosch via `python-smbus` using the I2C interface. 6 | 7 | Default settings are suitable for Raspberry Pi 2 and 3 and was successfully tested using a [breakout](https://github.com/watterott/BME280-Breakout). 8 | 9 | I created this Python library in style of e.g. [python-veml6070](https://github.com/cmur2/python-veml6070) or [python-tsl2591](https://github.com/maxlklaxl/python-tsl2591) since I found only [python scripts](https://github.com/SWITCHSCIENCE/BME280) with limited functionality and minor bugs and the official driver from Bosch is only in C(++). 10 | 11 | Although, it is heavily based on existing code from Bosch translated to Python and from [SWITCHSCIENCE](https://github.com/SWITCHSCIENCE/BME280). 12 | 13 | ## Usage 14 | 15 | Consult the data sheet and see [demo.py](demo.py) for clues how to use this library. 16 | 17 | Not all functions of the chip are supported since I focused on the *forced mode* but data readout and parameter setting should work in *normal mode*, too. Please send pull requests for improvements and bug fixes! 18 | 19 | ## Develop 20 | 21 | Run `make help` to find out about the available development commands. 22 | 23 | ## License 24 | 25 | Python files in this repository are released under the [MIT license](LICENSE) except those parts from other sources which are indicated where appropriate in the files. 26 | -------------------------------------------------------------------------------- /bme280/__init__.py: -------------------------------------------------------------------------------- 1 | from .bme280 import Bme280 2 | from .bme280 import HO_SKIPPED, HO_1, HO_2, HO_4, HO_8, HO_16 3 | from .bme280 import PO_SKIPPED, PO_1, PO_2, PO_4, PO_8, PO_16 4 | from .bme280 import TO_SKIPPED, TO_1, TO_2, TO_4, TO_8, TO_16 5 | from .bme280 import MODE_SLEEP, MODE_FORCED, MODE_NORMAL 6 | from .bme280 import TSTANDBY_0_5, TSTANDBY_62_5, TSTANDBY_125, TSTANDBY_250, TSTANDBY_500, TSTANDBY_1000 7 | from .bme280 import TSTANDBY_10, TSTANDBY_20 8 | from .bme280 import FILTER_OFF, FILTER_2, FILTER_4, FILTER_8, FILTER_16 9 | -------------------------------------------------------------------------------- /bme280/bme280.py: -------------------------------------------------------------------------------- 1 | import time 2 | 3 | import smbus # pylint: disable=import-error 4 | 5 | ADDR = 0x76 # 7bit address of the BME280 for SDO=0, else 0x77 6 | 7 | REGISTER_ID = 0xD0 8 | REGISTER_RESET = 0xE0 9 | REGISTER_CTRL_HUM = 0xF2 10 | REGISTER_STATUS = 0xF3 11 | REGISTER_CTRL_MEAS = 0xF4 12 | REGISTER_CONFIG = 0xF5 13 | 14 | HO_SKIPPED = 0x00 15 | HO_1 = 0x01 16 | HO_2 = 0x02 17 | HO_4 = 0x03 18 | HO_8 = 0x04 19 | HO_16 = 0x05 # and all higher 20 | 21 | PO_SKIPPED = 0x00 22 | PO_1 = 0x01 23 | PO_2 = 0x02 24 | PO_4 = 0x03 25 | PO_8 = 0x04 26 | PO_16 = 0x05 # and all higher 27 | 28 | TO_SKIPPED = 0x00 29 | TO_1 = 0x01 30 | TO_2 = 0x02 31 | TO_4 = 0x03 32 | TO_8 = 0x04 33 | TO_16 = 0x05 # and all higher 34 | 35 | MODE_SLEEP = 0x00 36 | MODE_FORCED = 0x01 # and 0x02 37 | MODE_NORMAL = 0x03 38 | 39 | TSTANDBY_0_5 = 0x00 40 | TSTANDBY_62_5 = 0x01 41 | TSTANDBY_125 = 0x02 42 | TSTANDBY_250 = 0x03 43 | TSTANDBY_500 = 0x04 44 | TSTANDBY_1000 = 0x05 45 | TSTANDBY_10 = 0x06 46 | TSTANDBY_20 = 0x07 47 | 48 | FILTER_OFF = 0x00 49 | FILTER_2 = 0x01 50 | FILTER_4 = 0x02 51 | FILTER_8 = 0x03 52 | FILTER_16 = 0x04 # and all higher 53 | 54 | 55 | class Bme280(): 56 | 57 | def __init__(self, i2c_bus=1, sensor_address=ADDR): 58 | self.bus = smbus.SMBus(i2c_bus) 59 | self.sensor_address = sensor_address 60 | self.ho = HO_1 61 | self.po = PO_1 62 | self.to = TO_1 63 | self.mode = MODE_SLEEP 64 | self.tstandy = TSTANDBY_1000 65 | self.filter = FILTER_OFF 66 | 67 | self.read_calibration_parameters() 68 | 69 | # initialize once 70 | self.bus.write_byte_data(self.sensor_address, REGISTER_CTRL_HUM, self.get_reg_ctrl_hum()) 71 | self.bus.write_byte_data(self.sensor_address, REGISTER_CTRL_MEAS, self.get_reg_ctrl_meas()) 72 | self.bus.write_byte_data(self.sensor_address, REGISTER_CONFIG, self.get_reg_config()) 73 | 74 | def get_chip_id(self): 75 | return self.bus.read_byte_data(self.sensor_address, REGISTER_ID) 76 | 77 | def reset(self): 78 | self.bus.write_byte_data(self.sensor_address, REGISTER_RESET, 0xB6) 79 | 80 | def is_status_measuring(self): 81 | return (self.bus.read_byte_data(self.sensor_address, REGISTER_STATUS) & 0x08) != 0x00 82 | 83 | def is_status_image_register_updating(self): 84 | return (self.bus.read_byte_data(self.sensor_address, REGISTER_STATUS) & 0x01) != 0x00 85 | 86 | def set_humidity_oversampling(self, ho): 87 | self.ho = ho 88 | self.bus.write_byte_data(self.sensor_address, REGISTER_CTRL_HUM, self.get_reg_ctrl_hum()) 89 | # flush (unchanged) CTRL_MEAS to make CTRL_HUM effective! 90 | self.bus.write_byte_data(self.sensor_address, REGISTER_CTRL_MEAS, self.get_reg_ctrl_meas()) 91 | 92 | def get_humidity_oversampling(self): 93 | return self.ho 94 | 95 | def set_temperature_oversampling(self, to): 96 | self.to = to 97 | self.bus.write_byte_data(self.sensor_address, REGISTER_CTRL_MEAS, self.get_reg_ctrl_meas()) 98 | 99 | def get_temperature_oversampling(self): 100 | return self.to 101 | 102 | def set_pressure_oversampling(self, po): 103 | self.po = po 104 | self.bus.write_byte_data(self.sensor_address, REGISTER_CTRL_MEAS, self.get_reg_ctrl_meas()) 105 | 106 | def get_pressure_oversampling(self): 107 | return self.po 108 | 109 | def set_mode(self, mode): 110 | self.mode = mode 111 | self.bus.write_byte_data(self.sensor_address, REGISTER_CTRL_MEAS, self.get_reg_ctrl_meas()) 112 | 113 | def get_mode(self): 114 | return self.mode 115 | 116 | def set_tstandy(self, tstandy): 117 | self.tstandy = tstandy 118 | self.bus.write_byte_data(self.sensor_address, REGISTER_CONFIG, self.get_reg_config()) 119 | 120 | def get_tstandy(self): 121 | return self.tstandy 122 | 123 | def set_filter(self, fil): 124 | self.filter = fil 125 | self.bus.write_byte_data(self.sensor_address, REGISTER_CONFIG, self.get_reg_config()) 126 | 127 | def get_filter(self): 128 | return self.filter 129 | 130 | def get_data(self): 131 | if self.get_mode() == MODE_FORCED: 132 | t_measure_max = 1.25 + (2.3 * self.to) + (2.3 * self.po + 0.575) + (2.3 * self.ho + 0.575) 133 | time.sleep(t_measure_max / 1000.0) 134 | 135 | data = [] 136 | for i in range(0xF7, 0xF7 + 8): 137 | data.append(self.bus.read_byte_data(self.sensor_address, i)) 138 | 139 | pressure_raw = (data[0] << 12) | (data[1] << 4) | (data[2] >> 4) 140 | temperature_raw = (data[3] << 12) | (data[4] << 4) | (data[5] >> 4) 141 | humidity_raw = (data[6] << 8) | data[7] 142 | t_fine = self.calc_t_fine(temperature_raw) 143 | t = self.calc_compensated_temperature(t_fine) 144 | p = self.calc_compensated_pressure(t_fine, pressure_raw) 145 | h = self.calc_compensated_humidity(t_fine, humidity_raw) 146 | 147 | if self.get_mode() == MODE_FORCED: 148 | # chip returns to sleep after data readout automatically, mirror it 149 | self.mode = MODE_SLEEP 150 | 151 | return (t, p, h) 152 | 153 | def get_reg_ctrl_hum(self): 154 | """ 155 | returns the bit pattern for CTRL_HUM corresponding to the desired state of this class 156 | """ 157 | return self.ho & 0x07 158 | 159 | def get_reg_ctrl_meas(self): 160 | """ 161 | returns the bit pattern for CTRL_MEAS corresponding to the desired state of this class 162 | """ 163 | return ((self.to & 0x07) << 5) | ((self.po & 0x07) << 2) | self.mode 164 | 165 | def get_reg_config(self): 166 | """ 167 | returns the bit pattern for CONFIG corresponding to the desired state of this class 168 | """ 169 | # SPI permanently disabled 170 | return ((self.tstandy & 0x07) << 5) | ((self.filter & 0x07) << 2) | 0x00 171 | 172 | # Bug-fixed code, originally from https://github.com/SWITCHSCIENCE/BME280 173 | 174 | def read_calibration_parameters(self): 175 | # read all calibration registers from chip NVM 176 | calibration_regs = [] 177 | for i in range(0x88, 0x88 + 24): 178 | calibration_regs.append(self.bus.read_byte_data(self.sensor_address, i)) 179 | calibration_regs.append(self.bus.read_byte_data(self.sensor_address, 0xA1)) 180 | for i in range(0xE1, 0xE1 + 7): 181 | calibration_regs.append(self.bus.read_byte_data(self.sensor_address, i)) 182 | 183 | # pylint: disable=bad-option-value,bad-whitespace 184 | 185 | # reorganize 8-bit words into compensation words (without correct sign) 186 | self.digT = [] 187 | self.digT.append((calibration_regs[1] << 8) | calibration_regs[0]) 188 | self.digT.append((calibration_regs[3] << 8) | calibration_regs[2]) 189 | self.digT.append((calibration_regs[5] << 8) | calibration_regs[4]) 190 | 191 | self.digP = [] 192 | self.digP.append((calibration_regs[7] << 8) | calibration_regs[6]) 193 | self.digP.append((calibration_regs[9] << 8) | calibration_regs[8]) 194 | self.digP.append((calibration_regs[11] << 8) | calibration_regs[10]) 195 | self.digP.append((calibration_regs[13] << 8) | calibration_regs[12]) 196 | self.digP.append((calibration_regs[15] << 8) | calibration_regs[14]) 197 | self.digP.append((calibration_regs[17] << 8) | calibration_regs[16]) 198 | self.digP.append((calibration_regs[19] << 8) | calibration_regs[18]) 199 | self.digP.append((calibration_regs[21] << 8) | calibration_regs[20]) 200 | self.digP.append((calibration_regs[23] << 8) | calibration_regs[22]) 201 | 202 | self.digH = [] 203 | self.digH.append(calibration_regs[24]) 204 | self.digH.append((calibration_regs[26] << 8) | calibration_regs[25]) 205 | self.digH.append(calibration_regs[27]) 206 | self.digH.append((calibration_regs[28] << 4) | (0x0F & calibration_regs[29])) 207 | self.digH.append((calibration_regs[30] << 4) | ((calibration_regs[29] >> 4) & 0x0F)) 208 | self.digH.append(calibration_regs[31]) 209 | 210 | # fix sign for integers in two's complement 211 | for i in [1, 2]: 212 | if self.digT[i] & 0x8000: 213 | self.digT[i] = (-self.digT[i] ^ 0xFFFF) + 1 214 | 215 | for i in [1, 2, 3, 4, 5, 6, 7, 8]: 216 | if self.digP[i] & 0x8000: 217 | self.digP[i] = (-self.digP[i] ^ 0xFFFF) + 1 218 | 219 | for i in [1]: 220 | if self.digH[i] & 0x8000: 221 | self.digH[i] = (-self.digH[i] ^ 0xFFFF) + 1 222 | for i in [3, 4]: 223 | if self.digH[i] & 0x0800: 224 | self.digH[i] = (-self.digH[i] ^ 0x0FFF) + 1 225 | for i in [5]: 226 | if self.digH[i] & 0x0080: 227 | self.digH[i] = (-self.digH[i] ^ 0x00FF) + 1 228 | 229 | # Code from Bosch datasheet translated to Python 230 | 231 | def calc_t_fine(self, adc_T): 232 | var1 = (adc_T / 16384.0 - self.digT[0] / 1024.0) * self.digT[1] 233 | var2 = (adc_T / 131072.0 - self.digT[0] / 8192.0) * (adc_T / 131072.0 - self.digT[0] / 8192.0) * self.digT[2] 234 | return var1 + var2 235 | 236 | @staticmethod 237 | def calc_compensated_temperature(t_fine): 238 | return t_fine / 5120.0 239 | 240 | def calc_compensated_pressure(self, t_fine, adc_P): 241 | var1 = (t_fine / 2.0) - 64000.0 242 | var2 = var1 * var1 * (self.digP[5]) / 32768.0 243 | var2 = var2 + var1 * (self.digP[4]) * 2.0 244 | var2 = (var2 / 4.0) + (self.digP[3] * 65536.0) 245 | var1 = (self.digP[2] * var1 * var1 / 524288.0 + self.digP[1] * var1) / 524288.0 246 | var1 = (1.0 + var1 / 32768.0) * self.digP[0] 247 | if var1 == 0.0: 248 | return 0 # avoid exception caused by division by zero 249 | p = 1048576.0 - adc_P 250 | p = (p - (var2 / 4096.0)) * 6250.0 / var1 251 | var1 = self.digP[8] * p * p / 2147483648.0 252 | var2 = p * self.digP[7] / 32768.0 253 | return p + (var1 + var2 + self.digP[6]) / 16.0 254 | 255 | def calc_compensated_humidity(self, t_fine, adc_H): 256 | var_H = t_fine - 76800.0 257 | # yapf: disable 258 | # pylint: disable=line-too-long 259 | var_H = (adc_H - (self.digH[3] * 64.0 + self.digH[4] / 16384.0 * var_H)) * (self.digH[1] / 65536.0 * (1.0 + self.digH[5] / 67108864.0 * var_H * (1.0 + self.digH[2] / 67108864.0 * var_H))) 260 | # yapf: enable 261 | var_H = var_H * (1.0 - self.digH[0] * var_H / 524288.0) 262 | if var_H > 100.0: 263 | var_H = 100.0 264 | elif var_H < 0.0: 265 | var_H = 0.0 266 | return var_H 267 | -------------------------------------------------------------------------------- /demo.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | import bme280 4 | 5 | 6 | def main(): 7 | bme = bme280.Bme280() 8 | bme.set_mode(bme280.MODE_FORCED) 9 | t, p, h = bme.get_data() 10 | print("Temperature: %f °C" % t) 11 | print("Pressure: %f P" % p) 12 | print("Humidity: %f %%" % h) 13 | 14 | 15 | if __name__ == '__main__': 16 | main() 17 | -------------------------------------------------------------------------------- /pyproject.toml: -------------------------------------------------------------------------------- 1 | [build-system] 2 | requires = ["poetry>=1.0"] 3 | build-backend = "poetry.masonry.api" 4 | 5 | [tool.poetry] 6 | name = "bme280" 7 | version = "1.0.0" 8 | description = "A python library for accessing the BME280 combined humidity and pressure sensor from Bosch." 9 | authors = ["Christian Nicolai"] 10 | license = "MIT" 11 | homepage = "https://dev.mycrobase.de/gitea/cn/python-bme280" 12 | 13 | [tool.poetry.dependencies] 14 | python = "^3.7" 15 | smbus2 = "*" 16 | 17 | [tool.poetry.dev-dependencies] 18 | mock = "*" 19 | pylint = "*" 20 | pytest = "*" 21 | snapshottest = "*" 22 | rope = "*" 23 | toml = "*" 24 | yapf = "*" 25 | -------------------------------------------------------------------------------- /tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmur2/python-bme280/58b660bad714061dd0fadeb5901360810eb4bf5a/tests/__init__.py -------------------------------------------------------------------------------- /tests/bme280_test.py: -------------------------------------------------------------------------------- 1 | # import unittest 2 | import sys 3 | import time 4 | 5 | import mock 6 | 7 | import snapshottest 8 | 9 | # Note: prepare globally mocked modules first and then load our module 10 | MOCKED_SMBUS_MODULE = mock.Mock() 11 | sys.modules['smbus'] = MOCKED_SMBUS_MODULE 12 | time.sleep = lambda s: None 13 | import bme280 # pylint: disable=wrong-import-position 14 | 15 | 16 | # inspired by https://github.com/adafruit/Adafruit_Python_GPIO/blob/master/Adafruit_GPIO/I2C.py 17 | class MockSMBus(): 18 | def __init__(self, initial_read=None): 19 | self._log = [] 20 | self.initial_read = initial_read or {} 21 | 22 | def read_byte(self, addr): 23 | val = self.initial_read.get(addr).pop(0) 24 | self._log.append(('r', addr, val)) 25 | return val 26 | 27 | def write_byte(self, addr, val): 28 | self._log.append(('w', addr, val)) 29 | 30 | def read_byte_data(self, addr, cmd): 31 | val = self.initial_read.get(addr).pop(0) 32 | self._log.append(('w', addr, cmd)) 33 | self._log.append(('r', addr, val)) 34 | return val 35 | 36 | def write_byte_data(self, addr, cmd, val): 37 | self._log.append(('w', addr, cmd)) 38 | self._log.append(('w', addr, val)) 39 | 40 | 41 | def setup_mockbus(**kwargs): 42 | mockbus = MockSMBus(**kwargs) 43 | MOCKED_SMBUS_MODULE.SMBus.return_value = mockbus 44 | return mockbus 45 | 46 | 47 | def calibration_read(): 48 | return [0x00] * (24 + 1 + 7) 49 | 50 | 51 | # pylint: disable=protected-access 52 | class TestBme280(snapshottest.TestCase): 53 | def test_setup(self): 54 | mockbus = setup_mockbus(initial_read={0x76: calibration_read()}) 55 | bme = bme280.Bme280() 56 | MOCKED_SMBUS_MODULE.SMBus.assert_called_with(1) 57 | self.assertIsNotNone(bme) 58 | self.assertMatchSnapshot(mockbus._log) 59 | 60 | def test_chip_id(self): 61 | mockbus = setup_mockbus(initial_read={0x76: calibration_read() + [0x23]}) 62 | bme = bme280.Bme280() 63 | self.assertEqual(bme.get_chip_id(), 0x23) 64 | self.assertMatchSnapshot(mockbus._log) 65 | 66 | def test_reset(self): 67 | mockbus = setup_mockbus(initial_read={0x76: calibration_read()}) 68 | bme = bme280.Bme280() 69 | bme.reset() 70 | self.assertMatchSnapshot(mockbus._log) 71 | 72 | def test_status(self): 73 | mockbus = setup_mockbus(initial_read={0x76: calibration_read() + [0x08, 0x00, 0x01, 0x00]}) 74 | bme = bme280.Bme280() 75 | self.assertTrue(bme.is_status_measuring()) 76 | self.assertFalse(bme.is_status_measuring()) 77 | self.assertTrue(bme.is_status_image_register_updating()) 78 | self.assertFalse(bme.is_status_image_register_updating()) 79 | self.assertMatchSnapshot(mockbus._log) 80 | 81 | def test_oversampling(self): 82 | mockbus = setup_mockbus(initial_read={0x76: calibration_read()}) 83 | bme = bme280.Bme280() 84 | self.assertEqual(bme.get_humidity_oversampling(), bme280.HO_1) 85 | bme.set_humidity_oversampling(bme280.HO_16) 86 | self.assertEqual(bme.get_humidity_oversampling(), bme280.HO_16) 87 | self.assertEqual(bme.get_temperature_oversampling(), bme280.TO_1) 88 | bme.set_temperature_oversampling(bme280.TO_16) 89 | self.assertEqual(bme.get_temperature_oversampling(), bme280.TO_16) 90 | self.assertEqual(bme.get_pressure_oversampling(), bme280.PO_1) 91 | bme.set_pressure_oversampling(bme280.PO_16) 92 | self.assertEqual(bme.get_pressure_oversampling(), bme280.PO_16) 93 | self.assertMatchSnapshot(mockbus._log) 94 | 95 | def test_mode(self): 96 | mockbus = setup_mockbus(initial_read={0x76: calibration_read()}) 97 | bme = bme280.Bme280() 98 | self.assertEqual(bme.get_mode(), bme280.MODE_SLEEP) 99 | bme.set_mode(bme280.MODE_FORCED) 100 | self.assertEqual(bme.get_mode(), bme280.MODE_FORCED) 101 | self.assertMatchSnapshot(mockbus._log) 102 | 103 | def test_config(self): 104 | mockbus = setup_mockbus(initial_read={0x76: calibration_read()}) 105 | bme = bme280.Bme280() 106 | self.assertEqual(bme.get_tstandy(), bme280.TSTANDBY_1000) 107 | bme.set_tstandy(bme280.TSTANDBY_20) 108 | self.assertEqual(bme.get_tstandy(), bme280.TSTANDBY_20) 109 | self.assertEqual(bme.get_filter(), bme280.FILTER_OFF) 110 | bme.set_filter(bme280.FILTER_16) 111 | self.assertEqual(bme.get_filter(), bme280.FILTER_16) 112 | self.assertMatchSnapshot(mockbus._log) 113 | 114 | def test_data(self): 115 | mockbus = setup_mockbus(initial_read={0x76: calibration_read() + [0x00] * 8}) 116 | bme = bme280.Bme280() 117 | bme.set_mode(bme280.MODE_FORCED) 118 | t, p, h = bme.get_data() # pylint: disable=unused-variable 119 | # self.assertEqual(t, 0x00) 120 | self.assertMatchSnapshot(mockbus._log) 121 | -------------------------------------------------------------------------------- /tests/snapshots/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmur2/python-bme280/58b660bad714061dd0fadeb5901360810eb4bf5a/tests/snapshots/__init__.py -------------------------------------------------------------------------------- /tests/snapshots/snap_bme280_test.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # snapshottest: v1 - https://goo.gl/zC4yUc 3 | from __future__ import unicode_literals 4 | 5 | from snapshottest import Snapshot 6 | 7 | 8 | snapshots = Snapshot() 9 | 10 | snapshots['TestBme280::test_chip_id 1'] = [ 11 | ( 12 | 'w', 13 | 118, 14 | 136 15 | ), 16 | ( 17 | 'r', 18 | 118, 19 | 0 20 | ), 21 | ( 22 | 'w', 23 | 118, 24 | 137 25 | ), 26 | ( 27 | 'r', 28 | 118, 29 | 0 30 | ), 31 | ( 32 | 'w', 33 | 118, 34 | 138 35 | ), 36 | ( 37 | 'r', 38 | 118, 39 | 0 40 | ), 41 | ( 42 | 'w', 43 | 118, 44 | 139 45 | ), 46 | ( 47 | 'r', 48 | 118, 49 | 0 50 | ), 51 | ( 52 | 'w', 53 | 118, 54 | 140 55 | ), 56 | ( 57 | 'r', 58 | 118, 59 | 0 60 | ), 61 | ( 62 | 'w', 63 | 118, 64 | 141 65 | ), 66 | ( 67 | 'r', 68 | 118, 69 | 0 70 | ), 71 | ( 72 | 'w', 73 | 118, 74 | 142 75 | ), 76 | ( 77 | 'r', 78 | 118, 79 | 0 80 | ), 81 | ( 82 | 'w', 83 | 118, 84 | 143 85 | ), 86 | ( 87 | 'r', 88 | 118, 89 | 0 90 | ), 91 | ( 92 | 'w', 93 | 118, 94 | 144 95 | ), 96 | ( 97 | 'r', 98 | 118, 99 | 0 100 | ), 101 | ( 102 | 'w', 103 | 118, 104 | 145 105 | ), 106 | ( 107 | 'r', 108 | 118, 109 | 0 110 | ), 111 | ( 112 | 'w', 113 | 118, 114 | 146 115 | ), 116 | ( 117 | 'r', 118 | 118, 119 | 0 120 | ), 121 | ( 122 | 'w', 123 | 118, 124 | 147 125 | ), 126 | ( 127 | 'r', 128 | 118, 129 | 0 130 | ), 131 | ( 132 | 'w', 133 | 118, 134 | 148 135 | ), 136 | ( 137 | 'r', 138 | 118, 139 | 0 140 | ), 141 | ( 142 | 'w', 143 | 118, 144 | 149 145 | ), 146 | ( 147 | 'r', 148 | 118, 149 | 0 150 | ), 151 | ( 152 | 'w', 153 | 118, 154 | 150 155 | ), 156 | ( 157 | 'r', 158 | 118, 159 | 0 160 | ), 161 | ( 162 | 'w', 163 | 118, 164 | 151 165 | ), 166 | ( 167 | 'r', 168 | 118, 169 | 0 170 | ), 171 | ( 172 | 'w', 173 | 118, 174 | 152 175 | ), 176 | ( 177 | 'r', 178 | 118, 179 | 0 180 | ), 181 | ( 182 | 'w', 183 | 118, 184 | 153 185 | ), 186 | ( 187 | 'r', 188 | 118, 189 | 0 190 | ), 191 | ( 192 | 'w', 193 | 118, 194 | 154 195 | ), 196 | ( 197 | 'r', 198 | 118, 199 | 0 200 | ), 201 | ( 202 | 'w', 203 | 118, 204 | 155 205 | ), 206 | ( 207 | 'r', 208 | 118, 209 | 0 210 | ), 211 | ( 212 | 'w', 213 | 118, 214 | 156 215 | ), 216 | ( 217 | 'r', 218 | 118, 219 | 0 220 | ), 221 | ( 222 | 'w', 223 | 118, 224 | 157 225 | ), 226 | ( 227 | 'r', 228 | 118, 229 | 0 230 | ), 231 | ( 232 | 'w', 233 | 118, 234 | 158 235 | ), 236 | ( 237 | 'r', 238 | 118, 239 | 0 240 | ), 241 | ( 242 | 'w', 243 | 118, 244 | 159 245 | ), 246 | ( 247 | 'r', 248 | 118, 249 | 0 250 | ), 251 | ( 252 | 'w', 253 | 118, 254 | 161 255 | ), 256 | ( 257 | 'r', 258 | 118, 259 | 0 260 | ), 261 | ( 262 | 'w', 263 | 118, 264 | 225 265 | ), 266 | ( 267 | 'r', 268 | 118, 269 | 0 270 | ), 271 | ( 272 | 'w', 273 | 118, 274 | 226 275 | ), 276 | ( 277 | 'r', 278 | 118, 279 | 0 280 | ), 281 | ( 282 | 'w', 283 | 118, 284 | 227 285 | ), 286 | ( 287 | 'r', 288 | 118, 289 | 0 290 | ), 291 | ( 292 | 'w', 293 | 118, 294 | 228 295 | ), 296 | ( 297 | 'r', 298 | 118, 299 | 0 300 | ), 301 | ( 302 | 'w', 303 | 118, 304 | 229 305 | ), 306 | ( 307 | 'r', 308 | 118, 309 | 0 310 | ), 311 | ( 312 | 'w', 313 | 118, 314 | 230 315 | ), 316 | ( 317 | 'r', 318 | 118, 319 | 0 320 | ), 321 | ( 322 | 'w', 323 | 118, 324 | 231 325 | ), 326 | ( 327 | 'r', 328 | 118, 329 | 0 330 | ), 331 | ( 332 | 'w', 333 | 118, 334 | 242 335 | ), 336 | ( 337 | 'w', 338 | 118, 339 | 1 340 | ), 341 | ( 342 | 'w', 343 | 118, 344 | 244 345 | ), 346 | ( 347 | 'w', 348 | 118, 349 | 36 350 | ), 351 | ( 352 | 'w', 353 | 118, 354 | 245 355 | ), 356 | ( 357 | 'w', 358 | 118, 359 | 160 360 | ), 361 | ( 362 | 'w', 363 | 118, 364 | 208 365 | ), 366 | ( 367 | 'r', 368 | 118, 369 | 35 370 | ) 371 | ] 372 | 373 | snapshots['TestBme280::test_config 1'] = [ 374 | ( 375 | 'w', 376 | 118, 377 | 136 378 | ), 379 | ( 380 | 'r', 381 | 118, 382 | 0 383 | ), 384 | ( 385 | 'w', 386 | 118, 387 | 137 388 | ), 389 | ( 390 | 'r', 391 | 118, 392 | 0 393 | ), 394 | ( 395 | 'w', 396 | 118, 397 | 138 398 | ), 399 | ( 400 | 'r', 401 | 118, 402 | 0 403 | ), 404 | ( 405 | 'w', 406 | 118, 407 | 139 408 | ), 409 | ( 410 | 'r', 411 | 118, 412 | 0 413 | ), 414 | ( 415 | 'w', 416 | 118, 417 | 140 418 | ), 419 | ( 420 | 'r', 421 | 118, 422 | 0 423 | ), 424 | ( 425 | 'w', 426 | 118, 427 | 141 428 | ), 429 | ( 430 | 'r', 431 | 118, 432 | 0 433 | ), 434 | ( 435 | 'w', 436 | 118, 437 | 142 438 | ), 439 | ( 440 | 'r', 441 | 118, 442 | 0 443 | ), 444 | ( 445 | 'w', 446 | 118, 447 | 143 448 | ), 449 | ( 450 | 'r', 451 | 118, 452 | 0 453 | ), 454 | ( 455 | 'w', 456 | 118, 457 | 144 458 | ), 459 | ( 460 | 'r', 461 | 118, 462 | 0 463 | ), 464 | ( 465 | 'w', 466 | 118, 467 | 145 468 | ), 469 | ( 470 | 'r', 471 | 118, 472 | 0 473 | ), 474 | ( 475 | 'w', 476 | 118, 477 | 146 478 | ), 479 | ( 480 | 'r', 481 | 118, 482 | 0 483 | ), 484 | ( 485 | 'w', 486 | 118, 487 | 147 488 | ), 489 | ( 490 | 'r', 491 | 118, 492 | 0 493 | ), 494 | ( 495 | 'w', 496 | 118, 497 | 148 498 | ), 499 | ( 500 | 'r', 501 | 118, 502 | 0 503 | ), 504 | ( 505 | 'w', 506 | 118, 507 | 149 508 | ), 509 | ( 510 | 'r', 511 | 118, 512 | 0 513 | ), 514 | ( 515 | 'w', 516 | 118, 517 | 150 518 | ), 519 | ( 520 | 'r', 521 | 118, 522 | 0 523 | ), 524 | ( 525 | 'w', 526 | 118, 527 | 151 528 | ), 529 | ( 530 | 'r', 531 | 118, 532 | 0 533 | ), 534 | ( 535 | 'w', 536 | 118, 537 | 152 538 | ), 539 | ( 540 | 'r', 541 | 118, 542 | 0 543 | ), 544 | ( 545 | 'w', 546 | 118, 547 | 153 548 | ), 549 | ( 550 | 'r', 551 | 118, 552 | 0 553 | ), 554 | ( 555 | 'w', 556 | 118, 557 | 154 558 | ), 559 | ( 560 | 'r', 561 | 118, 562 | 0 563 | ), 564 | ( 565 | 'w', 566 | 118, 567 | 155 568 | ), 569 | ( 570 | 'r', 571 | 118, 572 | 0 573 | ), 574 | ( 575 | 'w', 576 | 118, 577 | 156 578 | ), 579 | ( 580 | 'r', 581 | 118, 582 | 0 583 | ), 584 | ( 585 | 'w', 586 | 118, 587 | 157 588 | ), 589 | ( 590 | 'r', 591 | 118, 592 | 0 593 | ), 594 | ( 595 | 'w', 596 | 118, 597 | 158 598 | ), 599 | ( 600 | 'r', 601 | 118, 602 | 0 603 | ), 604 | ( 605 | 'w', 606 | 118, 607 | 159 608 | ), 609 | ( 610 | 'r', 611 | 118, 612 | 0 613 | ), 614 | ( 615 | 'w', 616 | 118, 617 | 161 618 | ), 619 | ( 620 | 'r', 621 | 118, 622 | 0 623 | ), 624 | ( 625 | 'w', 626 | 118, 627 | 225 628 | ), 629 | ( 630 | 'r', 631 | 118, 632 | 0 633 | ), 634 | ( 635 | 'w', 636 | 118, 637 | 226 638 | ), 639 | ( 640 | 'r', 641 | 118, 642 | 0 643 | ), 644 | ( 645 | 'w', 646 | 118, 647 | 227 648 | ), 649 | ( 650 | 'r', 651 | 118, 652 | 0 653 | ), 654 | ( 655 | 'w', 656 | 118, 657 | 228 658 | ), 659 | ( 660 | 'r', 661 | 118, 662 | 0 663 | ), 664 | ( 665 | 'w', 666 | 118, 667 | 229 668 | ), 669 | ( 670 | 'r', 671 | 118, 672 | 0 673 | ), 674 | ( 675 | 'w', 676 | 118, 677 | 230 678 | ), 679 | ( 680 | 'r', 681 | 118, 682 | 0 683 | ), 684 | ( 685 | 'w', 686 | 118, 687 | 231 688 | ), 689 | ( 690 | 'r', 691 | 118, 692 | 0 693 | ), 694 | ( 695 | 'w', 696 | 118, 697 | 242 698 | ), 699 | ( 700 | 'w', 701 | 118, 702 | 1 703 | ), 704 | ( 705 | 'w', 706 | 118, 707 | 244 708 | ), 709 | ( 710 | 'w', 711 | 118, 712 | 36 713 | ), 714 | ( 715 | 'w', 716 | 118, 717 | 245 718 | ), 719 | ( 720 | 'w', 721 | 118, 722 | 160 723 | ), 724 | ( 725 | 'w', 726 | 118, 727 | 245 728 | ), 729 | ( 730 | 'w', 731 | 118, 732 | 224 733 | ), 734 | ( 735 | 'w', 736 | 118, 737 | 245 738 | ), 739 | ( 740 | 'w', 741 | 118, 742 | 240 743 | ) 744 | ] 745 | 746 | snapshots['TestBme280::test_mode 1'] = [ 747 | ( 748 | 'w', 749 | 118, 750 | 136 751 | ), 752 | ( 753 | 'r', 754 | 118, 755 | 0 756 | ), 757 | ( 758 | 'w', 759 | 118, 760 | 137 761 | ), 762 | ( 763 | 'r', 764 | 118, 765 | 0 766 | ), 767 | ( 768 | 'w', 769 | 118, 770 | 138 771 | ), 772 | ( 773 | 'r', 774 | 118, 775 | 0 776 | ), 777 | ( 778 | 'w', 779 | 118, 780 | 139 781 | ), 782 | ( 783 | 'r', 784 | 118, 785 | 0 786 | ), 787 | ( 788 | 'w', 789 | 118, 790 | 140 791 | ), 792 | ( 793 | 'r', 794 | 118, 795 | 0 796 | ), 797 | ( 798 | 'w', 799 | 118, 800 | 141 801 | ), 802 | ( 803 | 'r', 804 | 118, 805 | 0 806 | ), 807 | ( 808 | 'w', 809 | 118, 810 | 142 811 | ), 812 | ( 813 | 'r', 814 | 118, 815 | 0 816 | ), 817 | ( 818 | 'w', 819 | 118, 820 | 143 821 | ), 822 | ( 823 | 'r', 824 | 118, 825 | 0 826 | ), 827 | ( 828 | 'w', 829 | 118, 830 | 144 831 | ), 832 | ( 833 | 'r', 834 | 118, 835 | 0 836 | ), 837 | ( 838 | 'w', 839 | 118, 840 | 145 841 | ), 842 | ( 843 | 'r', 844 | 118, 845 | 0 846 | ), 847 | ( 848 | 'w', 849 | 118, 850 | 146 851 | ), 852 | ( 853 | 'r', 854 | 118, 855 | 0 856 | ), 857 | ( 858 | 'w', 859 | 118, 860 | 147 861 | ), 862 | ( 863 | 'r', 864 | 118, 865 | 0 866 | ), 867 | ( 868 | 'w', 869 | 118, 870 | 148 871 | ), 872 | ( 873 | 'r', 874 | 118, 875 | 0 876 | ), 877 | ( 878 | 'w', 879 | 118, 880 | 149 881 | ), 882 | ( 883 | 'r', 884 | 118, 885 | 0 886 | ), 887 | ( 888 | 'w', 889 | 118, 890 | 150 891 | ), 892 | ( 893 | 'r', 894 | 118, 895 | 0 896 | ), 897 | ( 898 | 'w', 899 | 118, 900 | 151 901 | ), 902 | ( 903 | 'r', 904 | 118, 905 | 0 906 | ), 907 | ( 908 | 'w', 909 | 118, 910 | 152 911 | ), 912 | ( 913 | 'r', 914 | 118, 915 | 0 916 | ), 917 | ( 918 | 'w', 919 | 118, 920 | 153 921 | ), 922 | ( 923 | 'r', 924 | 118, 925 | 0 926 | ), 927 | ( 928 | 'w', 929 | 118, 930 | 154 931 | ), 932 | ( 933 | 'r', 934 | 118, 935 | 0 936 | ), 937 | ( 938 | 'w', 939 | 118, 940 | 155 941 | ), 942 | ( 943 | 'r', 944 | 118, 945 | 0 946 | ), 947 | ( 948 | 'w', 949 | 118, 950 | 156 951 | ), 952 | ( 953 | 'r', 954 | 118, 955 | 0 956 | ), 957 | ( 958 | 'w', 959 | 118, 960 | 157 961 | ), 962 | ( 963 | 'r', 964 | 118, 965 | 0 966 | ), 967 | ( 968 | 'w', 969 | 118, 970 | 158 971 | ), 972 | ( 973 | 'r', 974 | 118, 975 | 0 976 | ), 977 | ( 978 | 'w', 979 | 118, 980 | 159 981 | ), 982 | ( 983 | 'r', 984 | 118, 985 | 0 986 | ), 987 | ( 988 | 'w', 989 | 118, 990 | 161 991 | ), 992 | ( 993 | 'r', 994 | 118, 995 | 0 996 | ), 997 | ( 998 | 'w', 999 | 118, 1000 | 225 1001 | ), 1002 | ( 1003 | 'r', 1004 | 118, 1005 | 0 1006 | ), 1007 | ( 1008 | 'w', 1009 | 118, 1010 | 226 1011 | ), 1012 | ( 1013 | 'r', 1014 | 118, 1015 | 0 1016 | ), 1017 | ( 1018 | 'w', 1019 | 118, 1020 | 227 1021 | ), 1022 | ( 1023 | 'r', 1024 | 118, 1025 | 0 1026 | ), 1027 | ( 1028 | 'w', 1029 | 118, 1030 | 228 1031 | ), 1032 | ( 1033 | 'r', 1034 | 118, 1035 | 0 1036 | ), 1037 | ( 1038 | 'w', 1039 | 118, 1040 | 229 1041 | ), 1042 | ( 1043 | 'r', 1044 | 118, 1045 | 0 1046 | ), 1047 | ( 1048 | 'w', 1049 | 118, 1050 | 230 1051 | ), 1052 | ( 1053 | 'r', 1054 | 118, 1055 | 0 1056 | ), 1057 | ( 1058 | 'w', 1059 | 118, 1060 | 231 1061 | ), 1062 | ( 1063 | 'r', 1064 | 118, 1065 | 0 1066 | ), 1067 | ( 1068 | 'w', 1069 | 118, 1070 | 242 1071 | ), 1072 | ( 1073 | 'w', 1074 | 118, 1075 | 1 1076 | ), 1077 | ( 1078 | 'w', 1079 | 118, 1080 | 244 1081 | ), 1082 | ( 1083 | 'w', 1084 | 118, 1085 | 36 1086 | ), 1087 | ( 1088 | 'w', 1089 | 118, 1090 | 245 1091 | ), 1092 | ( 1093 | 'w', 1094 | 118, 1095 | 160 1096 | ), 1097 | ( 1098 | 'w', 1099 | 118, 1100 | 244 1101 | ), 1102 | ( 1103 | 'w', 1104 | 118, 1105 | 37 1106 | ) 1107 | ] 1108 | 1109 | snapshots['TestBme280::test_oversampling 1'] = [ 1110 | ( 1111 | 'w', 1112 | 118, 1113 | 136 1114 | ), 1115 | ( 1116 | 'r', 1117 | 118, 1118 | 0 1119 | ), 1120 | ( 1121 | 'w', 1122 | 118, 1123 | 137 1124 | ), 1125 | ( 1126 | 'r', 1127 | 118, 1128 | 0 1129 | ), 1130 | ( 1131 | 'w', 1132 | 118, 1133 | 138 1134 | ), 1135 | ( 1136 | 'r', 1137 | 118, 1138 | 0 1139 | ), 1140 | ( 1141 | 'w', 1142 | 118, 1143 | 139 1144 | ), 1145 | ( 1146 | 'r', 1147 | 118, 1148 | 0 1149 | ), 1150 | ( 1151 | 'w', 1152 | 118, 1153 | 140 1154 | ), 1155 | ( 1156 | 'r', 1157 | 118, 1158 | 0 1159 | ), 1160 | ( 1161 | 'w', 1162 | 118, 1163 | 141 1164 | ), 1165 | ( 1166 | 'r', 1167 | 118, 1168 | 0 1169 | ), 1170 | ( 1171 | 'w', 1172 | 118, 1173 | 142 1174 | ), 1175 | ( 1176 | 'r', 1177 | 118, 1178 | 0 1179 | ), 1180 | ( 1181 | 'w', 1182 | 118, 1183 | 143 1184 | ), 1185 | ( 1186 | 'r', 1187 | 118, 1188 | 0 1189 | ), 1190 | ( 1191 | 'w', 1192 | 118, 1193 | 144 1194 | ), 1195 | ( 1196 | 'r', 1197 | 118, 1198 | 0 1199 | ), 1200 | ( 1201 | 'w', 1202 | 118, 1203 | 145 1204 | ), 1205 | ( 1206 | 'r', 1207 | 118, 1208 | 0 1209 | ), 1210 | ( 1211 | 'w', 1212 | 118, 1213 | 146 1214 | ), 1215 | ( 1216 | 'r', 1217 | 118, 1218 | 0 1219 | ), 1220 | ( 1221 | 'w', 1222 | 118, 1223 | 147 1224 | ), 1225 | ( 1226 | 'r', 1227 | 118, 1228 | 0 1229 | ), 1230 | ( 1231 | 'w', 1232 | 118, 1233 | 148 1234 | ), 1235 | ( 1236 | 'r', 1237 | 118, 1238 | 0 1239 | ), 1240 | ( 1241 | 'w', 1242 | 118, 1243 | 149 1244 | ), 1245 | ( 1246 | 'r', 1247 | 118, 1248 | 0 1249 | ), 1250 | ( 1251 | 'w', 1252 | 118, 1253 | 150 1254 | ), 1255 | ( 1256 | 'r', 1257 | 118, 1258 | 0 1259 | ), 1260 | ( 1261 | 'w', 1262 | 118, 1263 | 151 1264 | ), 1265 | ( 1266 | 'r', 1267 | 118, 1268 | 0 1269 | ), 1270 | ( 1271 | 'w', 1272 | 118, 1273 | 152 1274 | ), 1275 | ( 1276 | 'r', 1277 | 118, 1278 | 0 1279 | ), 1280 | ( 1281 | 'w', 1282 | 118, 1283 | 153 1284 | ), 1285 | ( 1286 | 'r', 1287 | 118, 1288 | 0 1289 | ), 1290 | ( 1291 | 'w', 1292 | 118, 1293 | 154 1294 | ), 1295 | ( 1296 | 'r', 1297 | 118, 1298 | 0 1299 | ), 1300 | ( 1301 | 'w', 1302 | 118, 1303 | 155 1304 | ), 1305 | ( 1306 | 'r', 1307 | 118, 1308 | 0 1309 | ), 1310 | ( 1311 | 'w', 1312 | 118, 1313 | 156 1314 | ), 1315 | ( 1316 | 'r', 1317 | 118, 1318 | 0 1319 | ), 1320 | ( 1321 | 'w', 1322 | 118, 1323 | 157 1324 | ), 1325 | ( 1326 | 'r', 1327 | 118, 1328 | 0 1329 | ), 1330 | ( 1331 | 'w', 1332 | 118, 1333 | 158 1334 | ), 1335 | ( 1336 | 'r', 1337 | 118, 1338 | 0 1339 | ), 1340 | ( 1341 | 'w', 1342 | 118, 1343 | 159 1344 | ), 1345 | ( 1346 | 'r', 1347 | 118, 1348 | 0 1349 | ), 1350 | ( 1351 | 'w', 1352 | 118, 1353 | 161 1354 | ), 1355 | ( 1356 | 'r', 1357 | 118, 1358 | 0 1359 | ), 1360 | ( 1361 | 'w', 1362 | 118, 1363 | 225 1364 | ), 1365 | ( 1366 | 'r', 1367 | 118, 1368 | 0 1369 | ), 1370 | ( 1371 | 'w', 1372 | 118, 1373 | 226 1374 | ), 1375 | ( 1376 | 'r', 1377 | 118, 1378 | 0 1379 | ), 1380 | ( 1381 | 'w', 1382 | 118, 1383 | 227 1384 | ), 1385 | ( 1386 | 'r', 1387 | 118, 1388 | 0 1389 | ), 1390 | ( 1391 | 'w', 1392 | 118, 1393 | 228 1394 | ), 1395 | ( 1396 | 'r', 1397 | 118, 1398 | 0 1399 | ), 1400 | ( 1401 | 'w', 1402 | 118, 1403 | 229 1404 | ), 1405 | ( 1406 | 'r', 1407 | 118, 1408 | 0 1409 | ), 1410 | ( 1411 | 'w', 1412 | 118, 1413 | 230 1414 | ), 1415 | ( 1416 | 'r', 1417 | 118, 1418 | 0 1419 | ), 1420 | ( 1421 | 'w', 1422 | 118, 1423 | 231 1424 | ), 1425 | ( 1426 | 'r', 1427 | 118, 1428 | 0 1429 | ), 1430 | ( 1431 | 'w', 1432 | 118, 1433 | 242 1434 | ), 1435 | ( 1436 | 'w', 1437 | 118, 1438 | 1 1439 | ), 1440 | ( 1441 | 'w', 1442 | 118, 1443 | 244 1444 | ), 1445 | ( 1446 | 'w', 1447 | 118, 1448 | 36 1449 | ), 1450 | ( 1451 | 'w', 1452 | 118, 1453 | 245 1454 | ), 1455 | ( 1456 | 'w', 1457 | 118, 1458 | 160 1459 | ), 1460 | ( 1461 | 'w', 1462 | 118, 1463 | 242 1464 | ), 1465 | ( 1466 | 'w', 1467 | 118, 1468 | 5 1469 | ), 1470 | ( 1471 | 'w', 1472 | 118, 1473 | 244 1474 | ), 1475 | ( 1476 | 'w', 1477 | 118, 1478 | 36 1479 | ), 1480 | ( 1481 | 'w', 1482 | 118, 1483 | 244 1484 | ), 1485 | ( 1486 | 'w', 1487 | 118, 1488 | 164 1489 | ), 1490 | ( 1491 | 'w', 1492 | 118, 1493 | 244 1494 | ), 1495 | ( 1496 | 'w', 1497 | 118, 1498 | 180 1499 | ) 1500 | ] 1501 | 1502 | snapshots['TestBme280::test_reset 1'] = [ 1503 | ( 1504 | 'w', 1505 | 118, 1506 | 136 1507 | ), 1508 | ( 1509 | 'r', 1510 | 118, 1511 | 0 1512 | ), 1513 | ( 1514 | 'w', 1515 | 118, 1516 | 137 1517 | ), 1518 | ( 1519 | 'r', 1520 | 118, 1521 | 0 1522 | ), 1523 | ( 1524 | 'w', 1525 | 118, 1526 | 138 1527 | ), 1528 | ( 1529 | 'r', 1530 | 118, 1531 | 0 1532 | ), 1533 | ( 1534 | 'w', 1535 | 118, 1536 | 139 1537 | ), 1538 | ( 1539 | 'r', 1540 | 118, 1541 | 0 1542 | ), 1543 | ( 1544 | 'w', 1545 | 118, 1546 | 140 1547 | ), 1548 | ( 1549 | 'r', 1550 | 118, 1551 | 0 1552 | ), 1553 | ( 1554 | 'w', 1555 | 118, 1556 | 141 1557 | ), 1558 | ( 1559 | 'r', 1560 | 118, 1561 | 0 1562 | ), 1563 | ( 1564 | 'w', 1565 | 118, 1566 | 142 1567 | ), 1568 | ( 1569 | 'r', 1570 | 118, 1571 | 0 1572 | ), 1573 | ( 1574 | 'w', 1575 | 118, 1576 | 143 1577 | ), 1578 | ( 1579 | 'r', 1580 | 118, 1581 | 0 1582 | ), 1583 | ( 1584 | 'w', 1585 | 118, 1586 | 144 1587 | ), 1588 | ( 1589 | 'r', 1590 | 118, 1591 | 0 1592 | ), 1593 | ( 1594 | 'w', 1595 | 118, 1596 | 145 1597 | ), 1598 | ( 1599 | 'r', 1600 | 118, 1601 | 0 1602 | ), 1603 | ( 1604 | 'w', 1605 | 118, 1606 | 146 1607 | ), 1608 | ( 1609 | 'r', 1610 | 118, 1611 | 0 1612 | ), 1613 | ( 1614 | 'w', 1615 | 118, 1616 | 147 1617 | ), 1618 | ( 1619 | 'r', 1620 | 118, 1621 | 0 1622 | ), 1623 | ( 1624 | 'w', 1625 | 118, 1626 | 148 1627 | ), 1628 | ( 1629 | 'r', 1630 | 118, 1631 | 0 1632 | ), 1633 | ( 1634 | 'w', 1635 | 118, 1636 | 149 1637 | ), 1638 | ( 1639 | 'r', 1640 | 118, 1641 | 0 1642 | ), 1643 | ( 1644 | 'w', 1645 | 118, 1646 | 150 1647 | ), 1648 | ( 1649 | 'r', 1650 | 118, 1651 | 0 1652 | ), 1653 | ( 1654 | 'w', 1655 | 118, 1656 | 151 1657 | ), 1658 | ( 1659 | 'r', 1660 | 118, 1661 | 0 1662 | ), 1663 | ( 1664 | 'w', 1665 | 118, 1666 | 152 1667 | ), 1668 | ( 1669 | 'r', 1670 | 118, 1671 | 0 1672 | ), 1673 | ( 1674 | 'w', 1675 | 118, 1676 | 153 1677 | ), 1678 | ( 1679 | 'r', 1680 | 118, 1681 | 0 1682 | ), 1683 | ( 1684 | 'w', 1685 | 118, 1686 | 154 1687 | ), 1688 | ( 1689 | 'r', 1690 | 118, 1691 | 0 1692 | ), 1693 | ( 1694 | 'w', 1695 | 118, 1696 | 155 1697 | ), 1698 | ( 1699 | 'r', 1700 | 118, 1701 | 0 1702 | ), 1703 | ( 1704 | 'w', 1705 | 118, 1706 | 156 1707 | ), 1708 | ( 1709 | 'r', 1710 | 118, 1711 | 0 1712 | ), 1713 | ( 1714 | 'w', 1715 | 118, 1716 | 157 1717 | ), 1718 | ( 1719 | 'r', 1720 | 118, 1721 | 0 1722 | ), 1723 | ( 1724 | 'w', 1725 | 118, 1726 | 158 1727 | ), 1728 | ( 1729 | 'r', 1730 | 118, 1731 | 0 1732 | ), 1733 | ( 1734 | 'w', 1735 | 118, 1736 | 159 1737 | ), 1738 | ( 1739 | 'r', 1740 | 118, 1741 | 0 1742 | ), 1743 | ( 1744 | 'w', 1745 | 118, 1746 | 161 1747 | ), 1748 | ( 1749 | 'r', 1750 | 118, 1751 | 0 1752 | ), 1753 | ( 1754 | 'w', 1755 | 118, 1756 | 225 1757 | ), 1758 | ( 1759 | 'r', 1760 | 118, 1761 | 0 1762 | ), 1763 | ( 1764 | 'w', 1765 | 118, 1766 | 226 1767 | ), 1768 | ( 1769 | 'r', 1770 | 118, 1771 | 0 1772 | ), 1773 | ( 1774 | 'w', 1775 | 118, 1776 | 227 1777 | ), 1778 | ( 1779 | 'r', 1780 | 118, 1781 | 0 1782 | ), 1783 | ( 1784 | 'w', 1785 | 118, 1786 | 228 1787 | ), 1788 | ( 1789 | 'r', 1790 | 118, 1791 | 0 1792 | ), 1793 | ( 1794 | 'w', 1795 | 118, 1796 | 229 1797 | ), 1798 | ( 1799 | 'r', 1800 | 118, 1801 | 0 1802 | ), 1803 | ( 1804 | 'w', 1805 | 118, 1806 | 230 1807 | ), 1808 | ( 1809 | 'r', 1810 | 118, 1811 | 0 1812 | ), 1813 | ( 1814 | 'w', 1815 | 118, 1816 | 231 1817 | ), 1818 | ( 1819 | 'r', 1820 | 118, 1821 | 0 1822 | ), 1823 | ( 1824 | 'w', 1825 | 118, 1826 | 242 1827 | ), 1828 | ( 1829 | 'w', 1830 | 118, 1831 | 1 1832 | ), 1833 | ( 1834 | 'w', 1835 | 118, 1836 | 244 1837 | ), 1838 | ( 1839 | 'w', 1840 | 118, 1841 | 36 1842 | ), 1843 | ( 1844 | 'w', 1845 | 118, 1846 | 245 1847 | ), 1848 | ( 1849 | 'w', 1850 | 118, 1851 | 160 1852 | ), 1853 | ( 1854 | 'w', 1855 | 118, 1856 | 224 1857 | ), 1858 | ( 1859 | 'w', 1860 | 118, 1861 | 182 1862 | ) 1863 | ] 1864 | 1865 | snapshots['TestBme280::test_setup 1'] = [ 1866 | ( 1867 | 'w', 1868 | 118, 1869 | 136 1870 | ), 1871 | ( 1872 | 'r', 1873 | 118, 1874 | 0 1875 | ), 1876 | ( 1877 | 'w', 1878 | 118, 1879 | 137 1880 | ), 1881 | ( 1882 | 'r', 1883 | 118, 1884 | 0 1885 | ), 1886 | ( 1887 | 'w', 1888 | 118, 1889 | 138 1890 | ), 1891 | ( 1892 | 'r', 1893 | 118, 1894 | 0 1895 | ), 1896 | ( 1897 | 'w', 1898 | 118, 1899 | 139 1900 | ), 1901 | ( 1902 | 'r', 1903 | 118, 1904 | 0 1905 | ), 1906 | ( 1907 | 'w', 1908 | 118, 1909 | 140 1910 | ), 1911 | ( 1912 | 'r', 1913 | 118, 1914 | 0 1915 | ), 1916 | ( 1917 | 'w', 1918 | 118, 1919 | 141 1920 | ), 1921 | ( 1922 | 'r', 1923 | 118, 1924 | 0 1925 | ), 1926 | ( 1927 | 'w', 1928 | 118, 1929 | 142 1930 | ), 1931 | ( 1932 | 'r', 1933 | 118, 1934 | 0 1935 | ), 1936 | ( 1937 | 'w', 1938 | 118, 1939 | 143 1940 | ), 1941 | ( 1942 | 'r', 1943 | 118, 1944 | 0 1945 | ), 1946 | ( 1947 | 'w', 1948 | 118, 1949 | 144 1950 | ), 1951 | ( 1952 | 'r', 1953 | 118, 1954 | 0 1955 | ), 1956 | ( 1957 | 'w', 1958 | 118, 1959 | 145 1960 | ), 1961 | ( 1962 | 'r', 1963 | 118, 1964 | 0 1965 | ), 1966 | ( 1967 | 'w', 1968 | 118, 1969 | 146 1970 | ), 1971 | ( 1972 | 'r', 1973 | 118, 1974 | 0 1975 | ), 1976 | ( 1977 | 'w', 1978 | 118, 1979 | 147 1980 | ), 1981 | ( 1982 | 'r', 1983 | 118, 1984 | 0 1985 | ), 1986 | ( 1987 | 'w', 1988 | 118, 1989 | 148 1990 | ), 1991 | ( 1992 | 'r', 1993 | 118, 1994 | 0 1995 | ), 1996 | ( 1997 | 'w', 1998 | 118, 1999 | 149 2000 | ), 2001 | ( 2002 | 'r', 2003 | 118, 2004 | 0 2005 | ), 2006 | ( 2007 | 'w', 2008 | 118, 2009 | 150 2010 | ), 2011 | ( 2012 | 'r', 2013 | 118, 2014 | 0 2015 | ), 2016 | ( 2017 | 'w', 2018 | 118, 2019 | 151 2020 | ), 2021 | ( 2022 | 'r', 2023 | 118, 2024 | 0 2025 | ), 2026 | ( 2027 | 'w', 2028 | 118, 2029 | 152 2030 | ), 2031 | ( 2032 | 'r', 2033 | 118, 2034 | 0 2035 | ), 2036 | ( 2037 | 'w', 2038 | 118, 2039 | 153 2040 | ), 2041 | ( 2042 | 'r', 2043 | 118, 2044 | 0 2045 | ), 2046 | ( 2047 | 'w', 2048 | 118, 2049 | 154 2050 | ), 2051 | ( 2052 | 'r', 2053 | 118, 2054 | 0 2055 | ), 2056 | ( 2057 | 'w', 2058 | 118, 2059 | 155 2060 | ), 2061 | ( 2062 | 'r', 2063 | 118, 2064 | 0 2065 | ), 2066 | ( 2067 | 'w', 2068 | 118, 2069 | 156 2070 | ), 2071 | ( 2072 | 'r', 2073 | 118, 2074 | 0 2075 | ), 2076 | ( 2077 | 'w', 2078 | 118, 2079 | 157 2080 | ), 2081 | ( 2082 | 'r', 2083 | 118, 2084 | 0 2085 | ), 2086 | ( 2087 | 'w', 2088 | 118, 2089 | 158 2090 | ), 2091 | ( 2092 | 'r', 2093 | 118, 2094 | 0 2095 | ), 2096 | ( 2097 | 'w', 2098 | 118, 2099 | 159 2100 | ), 2101 | ( 2102 | 'r', 2103 | 118, 2104 | 0 2105 | ), 2106 | ( 2107 | 'w', 2108 | 118, 2109 | 161 2110 | ), 2111 | ( 2112 | 'r', 2113 | 118, 2114 | 0 2115 | ), 2116 | ( 2117 | 'w', 2118 | 118, 2119 | 225 2120 | ), 2121 | ( 2122 | 'r', 2123 | 118, 2124 | 0 2125 | ), 2126 | ( 2127 | 'w', 2128 | 118, 2129 | 226 2130 | ), 2131 | ( 2132 | 'r', 2133 | 118, 2134 | 0 2135 | ), 2136 | ( 2137 | 'w', 2138 | 118, 2139 | 227 2140 | ), 2141 | ( 2142 | 'r', 2143 | 118, 2144 | 0 2145 | ), 2146 | ( 2147 | 'w', 2148 | 118, 2149 | 228 2150 | ), 2151 | ( 2152 | 'r', 2153 | 118, 2154 | 0 2155 | ), 2156 | ( 2157 | 'w', 2158 | 118, 2159 | 229 2160 | ), 2161 | ( 2162 | 'r', 2163 | 118, 2164 | 0 2165 | ), 2166 | ( 2167 | 'w', 2168 | 118, 2169 | 230 2170 | ), 2171 | ( 2172 | 'r', 2173 | 118, 2174 | 0 2175 | ), 2176 | ( 2177 | 'w', 2178 | 118, 2179 | 231 2180 | ), 2181 | ( 2182 | 'r', 2183 | 118, 2184 | 0 2185 | ), 2186 | ( 2187 | 'w', 2188 | 118, 2189 | 242 2190 | ), 2191 | ( 2192 | 'w', 2193 | 118, 2194 | 1 2195 | ), 2196 | ( 2197 | 'w', 2198 | 118, 2199 | 244 2200 | ), 2201 | ( 2202 | 'w', 2203 | 118, 2204 | 36 2205 | ), 2206 | ( 2207 | 'w', 2208 | 118, 2209 | 245 2210 | ), 2211 | ( 2212 | 'w', 2213 | 118, 2214 | 160 2215 | ) 2216 | ] 2217 | 2218 | snapshots['TestBme280::test_status 1'] = [ 2219 | ( 2220 | 'w', 2221 | 118, 2222 | 136 2223 | ), 2224 | ( 2225 | 'r', 2226 | 118, 2227 | 0 2228 | ), 2229 | ( 2230 | 'w', 2231 | 118, 2232 | 137 2233 | ), 2234 | ( 2235 | 'r', 2236 | 118, 2237 | 0 2238 | ), 2239 | ( 2240 | 'w', 2241 | 118, 2242 | 138 2243 | ), 2244 | ( 2245 | 'r', 2246 | 118, 2247 | 0 2248 | ), 2249 | ( 2250 | 'w', 2251 | 118, 2252 | 139 2253 | ), 2254 | ( 2255 | 'r', 2256 | 118, 2257 | 0 2258 | ), 2259 | ( 2260 | 'w', 2261 | 118, 2262 | 140 2263 | ), 2264 | ( 2265 | 'r', 2266 | 118, 2267 | 0 2268 | ), 2269 | ( 2270 | 'w', 2271 | 118, 2272 | 141 2273 | ), 2274 | ( 2275 | 'r', 2276 | 118, 2277 | 0 2278 | ), 2279 | ( 2280 | 'w', 2281 | 118, 2282 | 142 2283 | ), 2284 | ( 2285 | 'r', 2286 | 118, 2287 | 0 2288 | ), 2289 | ( 2290 | 'w', 2291 | 118, 2292 | 143 2293 | ), 2294 | ( 2295 | 'r', 2296 | 118, 2297 | 0 2298 | ), 2299 | ( 2300 | 'w', 2301 | 118, 2302 | 144 2303 | ), 2304 | ( 2305 | 'r', 2306 | 118, 2307 | 0 2308 | ), 2309 | ( 2310 | 'w', 2311 | 118, 2312 | 145 2313 | ), 2314 | ( 2315 | 'r', 2316 | 118, 2317 | 0 2318 | ), 2319 | ( 2320 | 'w', 2321 | 118, 2322 | 146 2323 | ), 2324 | ( 2325 | 'r', 2326 | 118, 2327 | 0 2328 | ), 2329 | ( 2330 | 'w', 2331 | 118, 2332 | 147 2333 | ), 2334 | ( 2335 | 'r', 2336 | 118, 2337 | 0 2338 | ), 2339 | ( 2340 | 'w', 2341 | 118, 2342 | 148 2343 | ), 2344 | ( 2345 | 'r', 2346 | 118, 2347 | 0 2348 | ), 2349 | ( 2350 | 'w', 2351 | 118, 2352 | 149 2353 | ), 2354 | ( 2355 | 'r', 2356 | 118, 2357 | 0 2358 | ), 2359 | ( 2360 | 'w', 2361 | 118, 2362 | 150 2363 | ), 2364 | ( 2365 | 'r', 2366 | 118, 2367 | 0 2368 | ), 2369 | ( 2370 | 'w', 2371 | 118, 2372 | 151 2373 | ), 2374 | ( 2375 | 'r', 2376 | 118, 2377 | 0 2378 | ), 2379 | ( 2380 | 'w', 2381 | 118, 2382 | 152 2383 | ), 2384 | ( 2385 | 'r', 2386 | 118, 2387 | 0 2388 | ), 2389 | ( 2390 | 'w', 2391 | 118, 2392 | 153 2393 | ), 2394 | ( 2395 | 'r', 2396 | 118, 2397 | 0 2398 | ), 2399 | ( 2400 | 'w', 2401 | 118, 2402 | 154 2403 | ), 2404 | ( 2405 | 'r', 2406 | 118, 2407 | 0 2408 | ), 2409 | ( 2410 | 'w', 2411 | 118, 2412 | 155 2413 | ), 2414 | ( 2415 | 'r', 2416 | 118, 2417 | 0 2418 | ), 2419 | ( 2420 | 'w', 2421 | 118, 2422 | 156 2423 | ), 2424 | ( 2425 | 'r', 2426 | 118, 2427 | 0 2428 | ), 2429 | ( 2430 | 'w', 2431 | 118, 2432 | 157 2433 | ), 2434 | ( 2435 | 'r', 2436 | 118, 2437 | 0 2438 | ), 2439 | ( 2440 | 'w', 2441 | 118, 2442 | 158 2443 | ), 2444 | ( 2445 | 'r', 2446 | 118, 2447 | 0 2448 | ), 2449 | ( 2450 | 'w', 2451 | 118, 2452 | 159 2453 | ), 2454 | ( 2455 | 'r', 2456 | 118, 2457 | 0 2458 | ), 2459 | ( 2460 | 'w', 2461 | 118, 2462 | 161 2463 | ), 2464 | ( 2465 | 'r', 2466 | 118, 2467 | 0 2468 | ), 2469 | ( 2470 | 'w', 2471 | 118, 2472 | 225 2473 | ), 2474 | ( 2475 | 'r', 2476 | 118, 2477 | 0 2478 | ), 2479 | ( 2480 | 'w', 2481 | 118, 2482 | 226 2483 | ), 2484 | ( 2485 | 'r', 2486 | 118, 2487 | 0 2488 | ), 2489 | ( 2490 | 'w', 2491 | 118, 2492 | 227 2493 | ), 2494 | ( 2495 | 'r', 2496 | 118, 2497 | 0 2498 | ), 2499 | ( 2500 | 'w', 2501 | 118, 2502 | 228 2503 | ), 2504 | ( 2505 | 'r', 2506 | 118, 2507 | 0 2508 | ), 2509 | ( 2510 | 'w', 2511 | 118, 2512 | 229 2513 | ), 2514 | ( 2515 | 'r', 2516 | 118, 2517 | 0 2518 | ), 2519 | ( 2520 | 'w', 2521 | 118, 2522 | 230 2523 | ), 2524 | ( 2525 | 'r', 2526 | 118, 2527 | 0 2528 | ), 2529 | ( 2530 | 'w', 2531 | 118, 2532 | 231 2533 | ), 2534 | ( 2535 | 'r', 2536 | 118, 2537 | 0 2538 | ), 2539 | ( 2540 | 'w', 2541 | 118, 2542 | 242 2543 | ), 2544 | ( 2545 | 'w', 2546 | 118, 2547 | 1 2548 | ), 2549 | ( 2550 | 'w', 2551 | 118, 2552 | 244 2553 | ), 2554 | ( 2555 | 'w', 2556 | 118, 2557 | 36 2558 | ), 2559 | ( 2560 | 'w', 2561 | 118, 2562 | 245 2563 | ), 2564 | ( 2565 | 'w', 2566 | 118, 2567 | 160 2568 | ), 2569 | ( 2570 | 'w', 2571 | 118, 2572 | 243 2573 | ), 2574 | ( 2575 | 'r', 2576 | 118, 2577 | 8 2578 | ), 2579 | ( 2580 | 'w', 2581 | 118, 2582 | 243 2583 | ), 2584 | ( 2585 | 'r', 2586 | 118, 2587 | 0 2588 | ), 2589 | ( 2590 | 'w', 2591 | 118, 2592 | 243 2593 | ), 2594 | ( 2595 | 'r', 2596 | 118, 2597 | 1 2598 | ), 2599 | ( 2600 | 'w', 2601 | 118, 2602 | 243 2603 | ), 2604 | ( 2605 | 'r', 2606 | 118, 2607 | 0 2608 | ) 2609 | ] 2610 | 2611 | snapshots['TestBme280::test_data 1'] = [ 2612 | ( 2613 | 'w', 2614 | 118, 2615 | 136 2616 | ), 2617 | ( 2618 | 'r', 2619 | 118, 2620 | 0 2621 | ), 2622 | ( 2623 | 'w', 2624 | 118, 2625 | 137 2626 | ), 2627 | ( 2628 | 'r', 2629 | 118, 2630 | 0 2631 | ), 2632 | ( 2633 | 'w', 2634 | 118, 2635 | 138 2636 | ), 2637 | ( 2638 | 'r', 2639 | 118, 2640 | 0 2641 | ), 2642 | ( 2643 | 'w', 2644 | 118, 2645 | 139 2646 | ), 2647 | ( 2648 | 'r', 2649 | 118, 2650 | 0 2651 | ), 2652 | ( 2653 | 'w', 2654 | 118, 2655 | 140 2656 | ), 2657 | ( 2658 | 'r', 2659 | 118, 2660 | 0 2661 | ), 2662 | ( 2663 | 'w', 2664 | 118, 2665 | 141 2666 | ), 2667 | ( 2668 | 'r', 2669 | 118, 2670 | 0 2671 | ), 2672 | ( 2673 | 'w', 2674 | 118, 2675 | 142 2676 | ), 2677 | ( 2678 | 'r', 2679 | 118, 2680 | 0 2681 | ), 2682 | ( 2683 | 'w', 2684 | 118, 2685 | 143 2686 | ), 2687 | ( 2688 | 'r', 2689 | 118, 2690 | 0 2691 | ), 2692 | ( 2693 | 'w', 2694 | 118, 2695 | 144 2696 | ), 2697 | ( 2698 | 'r', 2699 | 118, 2700 | 0 2701 | ), 2702 | ( 2703 | 'w', 2704 | 118, 2705 | 145 2706 | ), 2707 | ( 2708 | 'r', 2709 | 118, 2710 | 0 2711 | ), 2712 | ( 2713 | 'w', 2714 | 118, 2715 | 146 2716 | ), 2717 | ( 2718 | 'r', 2719 | 118, 2720 | 0 2721 | ), 2722 | ( 2723 | 'w', 2724 | 118, 2725 | 147 2726 | ), 2727 | ( 2728 | 'r', 2729 | 118, 2730 | 0 2731 | ), 2732 | ( 2733 | 'w', 2734 | 118, 2735 | 148 2736 | ), 2737 | ( 2738 | 'r', 2739 | 118, 2740 | 0 2741 | ), 2742 | ( 2743 | 'w', 2744 | 118, 2745 | 149 2746 | ), 2747 | ( 2748 | 'r', 2749 | 118, 2750 | 0 2751 | ), 2752 | ( 2753 | 'w', 2754 | 118, 2755 | 150 2756 | ), 2757 | ( 2758 | 'r', 2759 | 118, 2760 | 0 2761 | ), 2762 | ( 2763 | 'w', 2764 | 118, 2765 | 151 2766 | ), 2767 | ( 2768 | 'r', 2769 | 118, 2770 | 0 2771 | ), 2772 | ( 2773 | 'w', 2774 | 118, 2775 | 152 2776 | ), 2777 | ( 2778 | 'r', 2779 | 118, 2780 | 0 2781 | ), 2782 | ( 2783 | 'w', 2784 | 118, 2785 | 153 2786 | ), 2787 | ( 2788 | 'r', 2789 | 118, 2790 | 0 2791 | ), 2792 | ( 2793 | 'w', 2794 | 118, 2795 | 154 2796 | ), 2797 | ( 2798 | 'r', 2799 | 118, 2800 | 0 2801 | ), 2802 | ( 2803 | 'w', 2804 | 118, 2805 | 155 2806 | ), 2807 | ( 2808 | 'r', 2809 | 118, 2810 | 0 2811 | ), 2812 | ( 2813 | 'w', 2814 | 118, 2815 | 156 2816 | ), 2817 | ( 2818 | 'r', 2819 | 118, 2820 | 0 2821 | ), 2822 | ( 2823 | 'w', 2824 | 118, 2825 | 157 2826 | ), 2827 | ( 2828 | 'r', 2829 | 118, 2830 | 0 2831 | ), 2832 | ( 2833 | 'w', 2834 | 118, 2835 | 158 2836 | ), 2837 | ( 2838 | 'r', 2839 | 118, 2840 | 0 2841 | ), 2842 | ( 2843 | 'w', 2844 | 118, 2845 | 159 2846 | ), 2847 | ( 2848 | 'r', 2849 | 118, 2850 | 0 2851 | ), 2852 | ( 2853 | 'w', 2854 | 118, 2855 | 161 2856 | ), 2857 | ( 2858 | 'r', 2859 | 118, 2860 | 0 2861 | ), 2862 | ( 2863 | 'w', 2864 | 118, 2865 | 225 2866 | ), 2867 | ( 2868 | 'r', 2869 | 118, 2870 | 0 2871 | ), 2872 | ( 2873 | 'w', 2874 | 118, 2875 | 226 2876 | ), 2877 | ( 2878 | 'r', 2879 | 118, 2880 | 0 2881 | ), 2882 | ( 2883 | 'w', 2884 | 118, 2885 | 227 2886 | ), 2887 | ( 2888 | 'r', 2889 | 118, 2890 | 0 2891 | ), 2892 | ( 2893 | 'w', 2894 | 118, 2895 | 228 2896 | ), 2897 | ( 2898 | 'r', 2899 | 118, 2900 | 0 2901 | ), 2902 | ( 2903 | 'w', 2904 | 118, 2905 | 229 2906 | ), 2907 | ( 2908 | 'r', 2909 | 118, 2910 | 0 2911 | ), 2912 | ( 2913 | 'w', 2914 | 118, 2915 | 230 2916 | ), 2917 | ( 2918 | 'r', 2919 | 118, 2920 | 0 2921 | ), 2922 | ( 2923 | 'w', 2924 | 118, 2925 | 231 2926 | ), 2927 | ( 2928 | 'r', 2929 | 118, 2930 | 0 2931 | ), 2932 | ( 2933 | 'w', 2934 | 118, 2935 | 242 2936 | ), 2937 | ( 2938 | 'w', 2939 | 118, 2940 | 1 2941 | ), 2942 | ( 2943 | 'w', 2944 | 118, 2945 | 244 2946 | ), 2947 | ( 2948 | 'w', 2949 | 118, 2950 | 36 2951 | ), 2952 | ( 2953 | 'w', 2954 | 118, 2955 | 245 2956 | ), 2957 | ( 2958 | 'w', 2959 | 118, 2960 | 160 2961 | ), 2962 | ( 2963 | 'w', 2964 | 118, 2965 | 244 2966 | ), 2967 | ( 2968 | 'w', 2969 | 118, 2970 | 37 2971 | ), 2972 | ( 2973 | 'w', 2974 | 118, 2975 | 247 2976 | ), 2977 | ( 2978 | 'r', 2979 | 118, 2980 | 0 2981 | ), 2982 | ( 2983 | 'w', 2984 | 118, 2985 | 248 2986 | ), 2987 | ( 2988 | 'r', 2989 | 118, 2990 | 0 2991 | ), 2992 | ( 2993 | 'w', 2994 | 118, 2995 | 249 2996 | ), 2997 | ( 2998 | 'r', 2999 | 118, 3000 | 0 3001 | ), 3002 | ( 3003 | 'w', 3004 | 118, 3005 | 250 3006 | ), 3007 | ( 3008 | 'r', 3009 | 118, 3010 | 0 3011 | ), 3012 | ( 3013 | 'w', 3014 | 118, 3015 | 251 3016 | ), 3017 | ( 3018 | 'r', 3019 | 118, 3020 | 0 3021 | ), 3022 | ( 3023 | 'w', 3024 | 118, 3025 | 252 3026 | ), 3027 | ( 3028 | 'r', 3029 | 118, 3030 | 0 3031 | ), 3032 | ( 3033 | 'w', 3034 | 118, 3035 | 253 3036 | ), 3037 | ( 3038 | 'r', 3039 | 118, 3040 | 0 3041 | ), 3042 | ( 3043 | 'w', 3044 | 118, 3045 | 254 3046 | ), 3047 | ( 3048 | 'r', 3049 | 118, 3050 | 0 3051 | ) 3052 | ] 3053 | --------------------------------------------------------------------------------