1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-30 14:43:51 +00:00

Add support for TMP1075 temperature sensor (#4776)

* Add support for TMP1075 temperature sensor

TMP1075 is a temperature sensor with I2C interface in industry standard
LM75 form factor and pinout.

https://www.ti.com/product/TMP1075

Example YAML:

```yaml
sensor:
  - platform: tmp1075
    name: TMP1075 Temperature
    id: radiator_temp
    update_interval: 10s
    i2c_id: i2c_bus_1
    conversion_rate: 27.5ms
    alert:
      limit_low: 50
      limit_high: 75
      fault_count: 1
      polarity: active_high
```

* Add myself as codeowner of the TMP1075 component

* Include '°C' unit when logging low/high limit setting

* Reformat

No functional changes.

* Fix logging: use %.4f for temperatures, not %d

* Fix config initialisation

* Use relative include for `tmp1075.h`

* Apply formatting changes suggested by script/clang-tidy for ESP32

* Add YAML to test1.yaml

* Fix test1.yaml by giving TMP1075 a name

* Less verbose logging (debug -> verbose level)

* Schema: reduce accuracy_decimals to 2

* I2C address as hexadecimal

* Proper name for enum in Python

The enum on the C++ side was renamed (clang-tidy) but I forgot to take that
into account in the Python code.

* Expose 'alert function' to the code generator/YAML params and remove 'shutdown'

Shutdown mode doesn't work the way I expect it, so remove it until someone
actually asks for it.

Also 'alert mode' was renamed to 'alert function' for clarity.

* Move simple setters to header file

* Remove `load_config_();` function
This commit is contained in:
Sybren A. Stüvel
2023-05-26 07:01:21 +02:00
committed by GitHub
parent 79abd773a2
commit 97c1c34708
6 changed files with 326 additions and 0 deletions

View File

@@ -1299,6 +1299,17 @@ sensor:
id: temp_etuve
humidity:
name: "Humidity hyt271"
- platform: tmp1075
name: "Temperature TMP1075"
update_interval: 10s
i2c_id: i2c_bus
conversion_rate: 27.5ms
alert:
limit_low: 50
limit_high: 75
fault_count: 1
polarity: active_high
function: comparator
esp32_touch:
setup_mode: false