Commit Graph

44 Commits

Author SHA1 Message Date
dependabot[bot] 07c3ee75e5
Bump black from 23.12.1 to 24.2.0 (#6221)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: J. Nick Koston <nick@koston.org>
2024-02-21 15:53:50 +13:00
J. Nick Koston 25ab6f0297
Ensure filename is shown when YAML raises an error (#6139)
* Ensure filename is shown when YAML raises an error

fixes #5423
fixes #5377

* Ensure filename is shown when YAML raises an error

fixes #5423
fixes #5377

* Ensure filename is shown when YAML raises an error

fixes #5423
fixes #5377

* Ensure filename is shown when YAML raises an error

fixes #5423
fixes #5377

* Ensure filename is shown when YAML raises an error

fixes #5423
fixes #5377
2024-01-23 23:11:03 -06:00
J. Nick Koston 5220c9edf8
Fallback to pure-python loader for better error when YAML loading fails (#6081) 2024-01-15 08:06:13 +09:00
J. Nick Koston d9def0cb3a
Bump hypothesis to 6.92.1 (#6011) 2024-01-09 10:08:50 +09:00
Jesse Hills 442820deaf
Fix replaced - in allowed characters during object_id sanitizing (#5983) 2023-12-22 03:28:25 +13:00
J. Nick Koston 5c31bec8c2
Ensure names containing characters other than `a-z` `A-Z` `0-9` or `_` are unique (#5810) 2023-11-23 17:29:08 -06:00
Jimmy Hedman cdcb25be8e
Make precommit checks happy (#5751) 2023-11-15 12:38:36 +13:00
Jesse Hills 972598a698
Handle nanoseconds in config (#5695) 2023-11-08 21:34:44 +13:00
Kuba Szczodrzyński 056a28906b
Wizard: fix colored text in input prompts (#5313) 2023-09-21 10:09:23 +12:00
Jesse Hills fe81bcc003
Use /data directory for .esphome folder when running as HA add-on (#5374) 2023-09-12 09:26:48 +12:00
Kuba Szczodrzyński a9630ac847
Support for LibreTiny platform (RTL8710, BK7231 & other modules) (#3509)
Co-authored-by: Kuba Szczodrzyński <kuba@szczodrzynski.pl>
Co-authored-by: Sam Neirinck <git@samneirinck.com>
Co-authored-by: David Buezas <dbuezas@users.noreply.github.com>
Co-authored-by: Stroe Andrei Catalin <catalin2402@gmail.com>
Co-authored-by: Sam Neirinck <github@samneirinck.be>
Co-authored-by: Péter Sárközi <xmisterhu@gmail.com>
Co-authored-by: Hajo Noerenberg <hn@users.noreply.github.com>
2023-09-05 10:16:08 +12:00
Jesse Hills a84365659b
Read string of bool env and match against well known values (#5232) 2023-08-11 16:20:58 +12:00
Joel Goguen b3ed988119
Allow substitutions to be valid names (#4726) 2023-05-17 16:33:08 +12:00
Jesse Hills b4c2433bac
Run black over tests folder (#4824) 2023-05-15 16:09:56 +12:00
Fabian 3ac7bf3761
EntityBase: Move ObjectId to Flash (#4569)
* Move EntityBase Object Id from memory to flash.

* Sprinkler use common `setup_entity` method.

* Remove `EntityBase` from Sprinkler.

* Support for entity names set to None

* change so gh PR picks up commit.

---------

Co-authored-by: Your Name <you@example.com>
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2023-03-28 09:00:34 +00:00
Jesse Hills d220d41182
Bump python min to 3.9 (#3871) 2022-10-05 20:09:27 +13:00
Jesse Hills 89fd367297
YAML linting (#3779) 2022-09-06 15:48:01 +12:00
jimtng 5aa42e5e66
Add variable substitutions for !include (#3510) 2022-05-31 16:45:18 +12:00
Otto Winter debcaf6fb7
Add ESP32C3 and ESP32S2 support to dashboard (#3152)
* Add ESP32C3 and ESP32S2 support to dashboard

* Format

* Fix tests
2022-02-19 15:47:50 +01:00
Otto Winter 35e6a13cd1
Remove unused obj attribute from AssignmentExpression (#3145) 2022-02-09 14:56:42 +01:00
Jesse Hills 5c22065135
Change most references from hassio to ha-addon (#3178) 2022-02-09 23:46:20 +13:00
Jesse Hills 33f17f75a0
Upgrade ArduinoJson to 6.18.5 and migrate code (#2844) 2022-01-01 22:31:43 +13:00
Jesse Hills 3d51ac8df0
Use new platform component config blocks for wizard (#2885) 2021-12-08 09:22:03 +13:00
Paul Monigatti 05fe5db030
Relax the icon validator to allow non-mdi icons (#2764) 2021-11-23 09:21:14 +01:00
Oxan van Leeuwen f7b3f52731
Limit hostnames to 31 characters (#2531) 2021-10-22 12:09:47 +02: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
Otto Winter 1b89174558
Store source package in Component for debugging (#2070) 2021-08-24 06:49:19 +12:00
Dave T 1771e673d2
Warn if underscore character is used in hostname (#2079)
* Prevent underscore character being used in 'name'.

* Restrict underscores in hostnames, not all names.

* Use hostname validator for node name.

* Allow underscore in hostname but warn once.

* Add renaming instructions link to warning.

* Point underscore warning to FAQ section

Co-authored-by: Otto Winter <otto@otto-winter.com>

Co-authored-by: Otto Winter <otto@otto-winter.com>
2021-08-10 14:14:42 +02:00
Stefan Agner d9f09a7523
Initial ESP32-C3-DevKitM-1 board support (#2062)
Co-authored-by: Stijn Tintel <stijn@linux-ipv6.be>
2021-07-26 11:10:56 +02:00
Stefan Agner 159744e09e
Support library override using named library with repository (#2056) 2021-07-26 10:50:45 +02:00
Martin Weinelt 8ca34f7098
Bump hypothesis from 5.21.0 to 5.49.0 (#1753) 2021-07-05 10:10:59 +12:00
Otto Winter d4686c0fb1
Introduce new async-def coroutine syntax (#1657) 2021-05-17 17:14:15 +12:00
Farzad E 2225594ee8
Added an option to disable mDNS (#1716)
* Added an option to disable mDNS

* Fixed linter issues

* Moved the enable_mdns option to WiFi and Ethernet components

* extracted common method for add mdns library

* lint

Co-authored-by: Guillermo Ruffino <glm.net@gmail.com>
2021-05-06 12:31:42 -03:00
Peter Kuehne eaf9735eda
Disallow _ in node name (#1632) 2021-04-08 14:26:01 +02:00
Guillermo Ruffino 69879920eb
add-black (#1593)
* Add black

Update pre commit

Update pre commit

add empty line

* Format with black
2021-03-07 16:03:16 -03:00
Ian Leeder aea2e9a6bb
Add hyphen to supported name characters (#1223)
Co-authored-by: Otto Winter <otto@otto-winter.com>
2020-07-30 00:02:34 +02:00
Peter Kuehne ebbfab608c
Feature/wizard tests (#1167) 2020-07-23 23:51:14 +02:00
Peter Kuehne 67b4dcf8ae
Fix unit test warning for hypothesis deprecation (#1163) 2020-07-16 09:50:06 +02:00
Otto Winter d5c59292c8
Add pytest to CI (#1138) 2020-07-15 14:00:02 +02:00
Peter Kuehne 2012c769f6
Feature/fix unit tests (#1129) 2020-07-14 13:11:58 +02:00
Tim Savage d447548893
Tests for CPP Code generation and some Python3 improvements (#961)
* Basic pytest configuration

* Added unit_test script that triggers pytest

* Changed "fixtures" to fixture_path

This is consistent with pytest's tmp_path

* Initial unit tests for esphome.helpers

* Disabled coverage reporting for esphome/components.

Focus initial unittest efforts on the core code.

* Migrated some ip_address to hypothesis

* Added a hypothesis MAC address strategy

* Initial tests for core

* Added hypothesis to requirements

* Added tests for core classes

TestTimePeriod
Lambda
ID
DocumentLocation
DocumentRange
Define
Library

* Updated test config so package root is discovered

* Setup fixtures and inital tests for pins

* Added tests for validate GPIO

* Added tests for pin type

* Added initial config_validation tests

* Added more tests for config_validation

* Added comparison unit tests

* Added repr to core.TimePeriod. Simplified identifying faults in tests

* Fixed inverted gt/lt tests

* Some tests for Espcore

* Updated syntax for Python3

* Removed usage of kwarg that isn't required

* Started writing test cases

* Started writing test cases for cpp_generator

* Additional docs and more Python3 releated improvements

* More test cases for cpp_generator.

* Fixed linter errors

* Add codegen tests to ensure file API remains stable

* Add test cases for cpp_helpers
2020-04-19 21:05:58 -03:00
Guillermo Ruffino 43cf3063e0
removes comments from lambda (#998)
* removes comments from lambda

* include comments in lambda test

* pylint no else return
2020-04-05 22:14:49 -03:00
Tim Savage c632b0e1d4
Unittests for esphome python code (#931) 2020-03-12 14:27:22 -07:00