1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-28 13:43:54 +00:00

Add support for LTR390 (#1505)

* Add support for ltr390

* Fix linting errors

* Fix more linting errors

* Linting fixes continued

* Linting forever

* Another one

* Fix regression and linting

* Fix narrowing conversion

* Add test and bugfix

* Add codeowners

* Update CODEOWNERS

* Update sensor defs

* Reformatted with black

* Fixed device class import

* Update CODEOWNERS

* Update CODEOWNERS

* Adding all config options

As requested https://github.com/esphome/esphome/pull/1505#discussion_r597326897

* Moving test to different config file

test1.yml runs out of memory

* Update according to comments

* Add safety clause to reading modes

* Fix clang-tidy complaint

* Revert change to i2c component

* Fix for changes in dev

* Revert "Revert change to i2c component"

This reverts commit 2810df59e9.

Co-authored-by: Otto winter <otto@otto-winter.com>
Co-authored-by: Oxan van Leeuwen <oxan@oxanvanleeuwen.nl>
This commit is contained in:
Stephen Tierney
2021-09-22 21:24:19 +10:00
committed by GitHub
parent 654e31124e
commit b20760c93c
7 changed files with 376 additions and 2 deletions

View File

@@ -13,8 +13,6 @@ namespace i2c {
class I2CDevice;
class I2CRegister {
public:
I2CRegister(I2CDevice *parent, uint8_t a_register) : parent_(parent), register_(a_register) {}
I2CRegister &operator=(uint8_t value);
I2CRegister &operator&=(uint8_t value);
I2CRegister &operator|=(uint8_t value);
@@ -24,6 +22,10 @@ class I2CRegister {
uint8_t get() const;
protected:
friend class I2CDevice;
I2CRegister(I2CDevice *parent, uint8_t a_register) : parent_(parent), register_(a_register) {}
I2CDevice *parent_;
uint8_t register_;
};