Commit Graph

48 Commits

Author SHA1 Message Date
Jesse Hills
bb86db869a
Fix bad merge 2021-10-13 22:09:38 +13:00
Jesse Hills
4c4dd23e15
Merge branch 'release' into dev 2021-10-13 22:05:18 +13:00
Paul Monigatti
471b82f727
EntityBase Refactor (#2418)
* Renamed Nameable to EntityBase (cpp)

* Renamed NAMEABLE_SCHEMA to ENTITY_BASE_SCHEMA (Python)

* Renamed cg.Nameable to cg.EntityBase (Python)

* Remove redundant use of CONF_NAME from esp32_touch

* Remove redundant use of CONF_NAME from mcp3008

* Updated test

* Moved EntityBase from Component.h and Component.cpp

* Added icon property to EntityBase

* Added CONF_ICON to ENTITY_BASE_SCHEMA and added setup_entity function to cpp_helpers

* Added MQTT component getters for icon and disabled_by_default

* Lint

* Removed icon field from MQTT components

* Code generation now uses setup_entity to setENTITY_BASE_SCHEMA fields

* Removed unused import

* Added cstdint include

* Optimisation: don't set icon if it is empty

* Remove icon from NumberTraits and SelectTraits

* Removed unused import

* Integration and Total Daily Energy sensors now inherit icons from their parents during code generation

* Minor comment correction

* Removed redundant icon-handling code from sensor, switch, and text_sensor

* Update esphome/components/tsl2591/tsl2591.h

Co-authored-by: Oxan van Leeuwen <oxan@oxanvanleeuwen.nl>

* Added icon property to binary sensor, climate, cover, and fan component tests

* Added icons for Binary Sensor, Climate, Cover, Fan, and Light  to API

* Consolidated EntityBase fields in MQTT components

Co-authored-by: Oxan van Leeuwen <oxan@oxanvanleeuwen.nl>
2021-10-10 10:37:05 +02:00
Otto Winter
ac0d921413
ESP-IDF support and generic target platforms (#2303)
* Socket refactor and SSL

* esp-idf temp

* Fixes

* Echo component and noise

* Add noise API transport support

* Updates

* ESP-IDF

* Complete

* Fixes

* Fixes

* Versions update

* New i2c APIs

* Complete i2c refactor

* SPI migration

* Revert ESP Preferences migration, too complex for now

* OTA support

* Remove echo again

* Remove ssl again

* GPIOFlags updates

* Rename esphal and ICACHE_RAM_ATTR

* Make ESP32 arduino compilable again

* Fix GPIO flags

* Complete pin registry refactor and fixes

* Fixes to make test1 compile

* Remove sdkconfig file

* Ignore sdkconfig file

* Fixes in reviewing

* Make test2 compile

* Make test4 compile

* Make test5 compile

* Run clang-format

* Fix lint errors

* Use esp-idf APIs instead of btStart

* Another round of fixes

* Start implementing ESP8266

* Make test3 compile

* Guard esp8266 code

* Lint

* Reformat

* Fixes

* Fixes v2

* more fixes

* ESP-IDF tidy target

* Convert ARDUINO_ARCH_ESPxx

* Update WiFiSignalSensor

* Update time ifdefs

* OTA needs millis from hal

* RestartSwitch needs delay from hal

* ESP-IDF Uart

* Fix OTA blank password

* Allow setting sdkconfig

* Fix idf partitions and allow setting sdkconfig from yaml

* Re-add read/write compat APIs and fix esp8266 uart

* Fix esp8266 store log strings in flash

* Fix ESP32 arduino preferences not initialized

* Update ifdefs

* Change how sdkconfig change is detected

* Add checks to ci-custom and fix them

* Run clang-format

* Add esp-idf clang-tidy target and fix errors

* Fixes from clang-tidy idf round 2

* Fixes from compiling tests with esp-idf

* Run clang-format

* Switch test5.yaml to esp-idf

* Implement ESP8266 Preferences

* Lint

* Re-do PIO package version selection a bit

* Fix arduinoespressif32 package version

* Fix unit tests

* Lint

* Lint fixes

* Fix readv/writev not defined

* Fix graphing component

* Re-add all old options from core/config.py

Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2021-09-20 11:47:51 +02:00
Oxan van Leeuwen
8bda8e5393
Clean-up sensor integration (#2275) 2021-09-20 14:34:59 +12:00
Otto Winter
7c17e72db4
Add readv and writev for more efficient API packets (#2342) 2021-09-20 14:16:56 +12:00
Otto Winter
a990898256
Add readv and writev for more efficient API packets (#2342) 2021-09-20 10:33:10 +12:00
Oxan van Leeuwen
23ead416d5
Suppress excessive warnings about deprecated Fan interfaces (#2270) 2021-09-14 23:06:13 +12:00
Otto Winter
e92a9d1d9e
Fix API socket issues (#2288)
* Fix API socket issues

* Fix compile error against beta

* Format
2021-09-14 07:13:00 +12:00
Oxan van Leeuwen
e6b0a0ca2b
Clean-up sensor integration (#2275) 2021-09-13 18:58:49 +02:00
Otto Winter
ed7983af41
Fix API socket issues (#2288)
* Fix API socket issues

* Fix compile error against beta

* Format
2021-09-13 18:52:53 +02:00
Oxan van Leeuwen
40c474cd83
Run clang-tidy against ESP32 (#2147)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
Co-authored-by: Otto winter <otto@otto-winter.com>
2021-09-13 18:11:27 +02:00
Oxan van Leeuwen
e18dfdd656
Suppress excessive warnings about deprecated Fan interfaces (#2270) 2021-09-13 09:39:18 +02:00
Otto Winter
e5051eefbc
API encryption (#2254) 2021-09-09 09:22:47 +12:00
Otto Winter
2790d72bff
Convert API to use sockets (#2253)
* Socket component

* Lint

* Lint

* Fix esp8266 missing INADDR_ANY

* API convert to sockets and frame helper

* Fix compile error

Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2021-09-08 12:52:57 +02:00
Jesse Hills
ff6bed54c6
Remove last_reset_type and convert all those sensors to TOTAL_INCREASING (#2233) 2021-09-06 08:30:47 +12:00
Oxan van Leeuwen
1c1ad32610
Add deprecated attribute to some deprecated types/methods (#2185) 2021-08-24 06:48:12 +12:00
Oxan van Leeuwen
5ec9bb0fb5
Clean-up constant definitions (#2148) 2021-08-23 19:21:30 +12:00
Otto Winter
9b48ff5775
Fix native API log level enum values (#2151) 2021-08-16 11:57:50 +12:00
Oxan van Leeuwen
9173da0416
Always send all light state values in API (#2150) 2021-08-16 07:40:34 +12:00
Jesse Hills
93796491af
Allow entities to be disabled by default in HA (#2113)
Co-authored-by: Otto Winter <otto@otto-winter.com>
2021-08-10 13:45:31 +12:00
Jesse Hills
76991cdcc4
Add select entities and implement template select (#2067)
Co-authored-by: Otto Winter <otto@otto-winter.com>
2021-08-02 20:00:51 +12:00
Oxan van Leeuwen
5983ccc55c
Color mode implementation (#2012) 2021-07-29 19:11:56 +02:00
Jesse Hills
3b3297d269
Adding last_reset_type to sensors that should support it. (#2039) 2021-07-21 09:20:20 +12:00
Jesse Hills
71d9d64a02
Number and Template Number updates (#2036)
Co-authored-by: Otto winter <otto@otto-winter.com>
2021-07-20 08:22:49 +12:00
Jesse Hills
dd37a4e04c
Add Number entities (from Home Assistant) (#1971)
Co-authored-by: Oxan van Leeuwen <oxan@oxanvanleeuwen.nl>
2021-07-13 07:20:12 +12:00
Oxan van Leeuwen
f9797825ad
Change color model to fix white channel issues (#1895) 2021-07-08 21:37:47 +12:00
Otto Winter
c811141a4f
API raise minor version for climate changes (#1947) 2021-06-21 22:02:18 +02:00
Otto Winter
871c0ee2a5
Rework climate traits (#1941)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2021-06-21 21:17:01 +02:00
Stefan Agner
501f88ca86
Avoid non-const globals and enable clang-tidy check (#1892) 2021-06-11 08:19:44 +12:00
Jesse Hills
5cf18235e3
Allow setting creator project name and version into code (#1872) 2021-06-09 13:04:00 +12:00
Lumpusz
ebadaa9660
Add preset, custom_preset and custom_fan_mode support to climate (#1471)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2021-06-04 22:04:54 +12:00
Franck Nijhof
11fb54c74e
Add support for Sensor state class (#1835)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2021-06-03 13:49:56 +12:00
Franck Nijhof
5645be4e0f
Add attribute support to Home Assistant sensors (#1770)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2021-05-17 11:16:22 +12:00
Jim Ekman
7708b81ef5
Support fan speed levels (#1541)
* Add fan speed percentage support to the API

* Add float fan speed percentage

* Add percentage support to automation and configuration

* Update Tuya fan

* Fix pylint warning

* Update API to use speed levels instead of percentage

* Use speed levels

* Fix type warnings

* MQTT component now converts between speed levels and enums

* Webserver now supports speed_level

* Update prometheus

* Remove low/medium/high settings from speed fan

* Remove unused enum

* Configurable speed levels for speed fan

* Remove unused import

* Rename speed_level->speed and speed_levels->speed_count

* Rename supported_speed_levels -> supported_speed_count in API and FanTraits

Field id stays the same in the protocol, so the change is not breaking for aioesphome.
2021-03-17 10:40:02 -03:00
marecabo
f95be6a0df
Device class attribute for sensor component (#1525)
* Add constants for sensor device_class

* Add device_class attribute to sensor component

* Add device_class attribute to sensor class

* Add device_class to mhz19 temperature sensor

* Add device_class to sensor in api component

* Add test for device_class of sensor

* Rename DEVICE_CLASS_NONE to DEVICE_CLASS_EMPTY for consistency

* Make optional attributes of sensor component truly optional
2021-02-15 12:49:02 -03:00
mknjc
96ab6b51b8
API: copy the data to send into the tcp internal buffer (#1455)
Without the flag lwip only holds a reference to the supplied buffers and the reference must be valid until the tcp ack is received. This can't be guaranteed for stack allocated buffers
2021-01-11 10:46:21 -03:00
Jim Persson
0bb81e5b2d
Add support for controlling fan direction (#1051)
* Fix fan oscillation trait not being used

* Add fan direction support to SpeedFan

* Add fan direction to API

* Add fan direction support to BinaryFan

* Fix CI errors

* Fix python format

* Change some ordering to trigger CI

* Add test for the configuration
2020-06-14 16:54:31 -03:00
Guillermo Ruffino
14e9375262
test disable no delay (#1026)
* test disable no delay

* removed set_nodelay code
2020-04-30 23:00:57 -03:00
Guillermo Ruffino
1814e4a46b Add climate dry fan (#845)
* add climate dry fan

* clang-format

* updates, add swing mode, add back compat with old ha

* revert client-config add swing

* sort const.py

* fix missing retur
2019-11-16 16:34:11 +01:00
Otto Winter
51233e1931
Fix sensor force_update native API (#847)
Fixes https://github.com/esphome/issues/issues/842
2019-11-12 19:01:36 +01:00
Otto Winter
fb055750df
Add missing state attribute (#851)
* Add api missing_state attribute

Fixes https://github.com/esphome/issues/issues/828

Adds a new property for missing state, so that HA can now when a sensor does not have a state yet.

* Update api.proto
2019-11-12 18:58:26 +01:00
Otto Winter
66aa02fc34
Move native API enums to new namespace (#825)
Fixes https://github.com/esphome/issues/issues/801
2019-11-02 19:35:45 +01:00
Marcel van der Veldt
72d6471ab8 add support for climate action (#720)
* add support for climate action:

Following hass implementation of climate, action represents the current action the climate device is perfoming, e.g. cooling or heating

fix bang_bang climate:

make sure that the thresholds are always respected.
fixes the issue where the component would just keep on heating, regardless of the temperature range

* Updates

- Use dedicated enum for action (otherwise it gets confusing because "auto" is not a valid action)
- Add field to tell HA that action is supported
- Revert semantic changes in bang_bang

* Conditional print


Co-authored-by: Otto Winter <otto@otto-winter.com>
2019-10-18 10:39:14 +02:00
Otto Winter
4b0f203049
Use unique enum names for native API
Fixes https://github.com/esphome/issues/issues/617
2019-08-31 21:13:41 +02:00
Otto Winter
11e88019c2
Fix travis 2019-07-28 15:40:31 +02:00
Felix Eckhofer
a783637a7a Restore sending "None" effect type (#667)
This is a regression from 369d175694.
2019-07-21 13:11:34 +02:00
Otto Winter
369d175694
Create Protobuf Plugin for automatically generating native API stubs (#633)
* Create Protobuf Plugin for automatically generating native API stubs

* Format

* Delete api.proto

* Cleanup, use no_delay conditionally

* Updates

* Update

* Lint

* Lint

* Fixes

* Camera

* CustomAPIDevice

* Fix negative VarInt, Add User-defined services arrays

* Home Assistant Event

* Fixes

* Update custom_api_device.h
2019-06-18 19:31:22 +02:00