Commit Graph

32 Commits

Author SHA1 Message Date
guillempages 8a518f0def
Add transparency support to all image types (#4600) 2023-05-22 08:03:21 +12:00
NP v/d Spek 2f50e18eb5
fixing `shrink` and `extend` functions of the displaybuffer's Rect class (#4565)
* fixing rectangle's `shrink` and `extend`

* fixed the rect::shrink and rect::inside methods
and added rect:equal() method

* fixed internal clang issue again. When would is
this going to be fixed :(

* fixed internal clang issue again. When would is
this going to be fixed :(

* remove trailing space
2023-03-15 19:45:50 +00:00
Oxan van Leeuwen 801fbf44c5
Revert storing Font glyphs in manually-allocated memory (#4516)
This partially reverts commit 62459a8ae1.
2023-03-09 00:14:34 +00:00
Fabian 62459a8ae1
Move Font glyphs to SPI RAM. (#4485)
Co-authored-by: Your Name <you@example.com>
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2023-02-26 18:45:30 +00:00
NP v/d Spek 58eeb6b1b8
Fix check for empty clipping array (#4421) 2023-02-12 17:03:53 +01:00
NP v/d Spek f8acc45be4
Add Clipping to displaybuffer (#4271)
* adding Clipping support to the displaybuffer
- add rect structure

* removed unused define

* add missing property for storing the clipped areas

* include log header

* Move Rect method's code to cpp file
- removed obsolete remarks

* fixed reported issues

* make Rect class methods public

* clang fix

* Remove commented code

* Renaming clipping methods

* Multiple changes:
- replaced 32766 with VALUE_NO_SET
- fixed the way *_clipping(left, top, right, bottom) is stored
- add `is_clipping();`
- make sure that all clipped region are closed after `do_update_()`
- rename de parameters for `Rect::expand();`

* remove unneeded space

* replace define with static const uint8_t

* correcting my copy paste mistake

---------

Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2023-02-11 09:56:15 +13:00
NP v/d Spek 86a8e1f4a6
small DisplayBuffer images and font update (#4044)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2023-01-11 14:55:02 +13:00
Jesse Hills 9273e3775b
Add vector includes (#4080) 2022-11-24 13:12:55 +13:00
davestubbs 77fb02729e
Added support for setting the current animation frame (#3681) 2022-08-09 10:28:05 +12:00
guillempages d0dda48932
Add display_type property to DisplayBuffer (#3430)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2022-06-03 15:39:04 +12:00
LuBeDa 69118120d9
added prev_frame for animation (#3427) 2022-05-10 21:56:29 +12:00
LuBeDa 68dfaf238b
added RGB565 image type (#3229)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2022-04-27 08:41:10 +12:00
Wouter van der Wal a718ac7ee0
Add qr code support for displays (#2952)
Co-authored-by: Oxan van Leeuwen <oxan@oxanvanleeuwen.nl>
2022-01-26 22:20:45 +13:00
Jesse Hills ef832becf1
Create base touchscreen component and refactor ektf2232 (#3083)
Co-authored-by: Oxan van Leeuwen <oxan@oxanvanleeuwen.nl>
2022-01-26 16:26:46 +13:00
Jesse Hills 045952939e
Support simple transparent pngs for display (#3035) 2022-01-21 11:16:18 +13:00
Tim Niemueller 11f1e28139
Make per-loop display clearing optional (#2626)
Currently, in each loop during DisplayBuffer::update_() the display is
cleared by calling DisplayBuffer::clear().

This prevents more efficient display usages that do not render the
screen in each loop, but only if necessary. This can be helpful, for
example, if images are rendered. This would cause the loop time to be
exceeded frequently.

This change adds a new optional flag "auto_clear" that can be used to
control the clearing behavior. If unset, the DisplayBuffer defaults to
enabled auto clearing, the current behavior and thus backward compatible.

This flag applies to displays that use DisplayBuffer.

Example excerpt:
globals:
  - id: state
    type: bool
    restore_value: no
    initial_value: "false"
  - id: state_processed
    type: bool
    restore_value: no
    initial_value: "false"

switch:
  - platform: template
    name: "State"
    id: state_switch
    lambda: |-
      return id(state);
    turn_on_action:
      - globals.set:
          id: state
          value: "true"
      - globals.set:
          id: state_processed
          value: "false"
    turn_off_action:
      - globals.set:
          id: state
          value: "false"
      - globals.set:
          id: state_processed
          value: "false"

display:
  - platform: ili9341
    # ...
    auto_clear_enabled: false
    lambda: |-
      if (!id(state_processed)) {
        it.fill(COLOR_WHITE);
        if (id(state)) {
          it.image(80, 20, id(image1));
        } else {
          it.image(80, 20, id(image2));
        }
        id(state_processed) = true;
      }

Co-authored-by: Tim Niemueller <timdn@google.com>
2021-11-03 17:56:09 +01: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
synco 945ed5d3bd
Added graphing component (#2109)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
Co-authored-by: Oxan van Leeuwen <oxan@oxanvanleeuwen.nl>
Co-authored-by: Synco Reynders <synco@deviceware.co.nz>
Co-authored-by: Otto winter <otto@otto-winter.com>
2021-09-20 19:29:47 +12:00
Otto Winter 360effcb72
Activate some clang-tidy checks (#1884) 2021-06-10 13:04:40 +02:00
Stanislav Meduna 072dce340e
Add the on_page_change display trigger (#1687)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2021-05-24 08:56:04 +12:00
Stanislav Meduna 063d9c47a4
Refactor font creation to save stack (#1707) 2021-05-24 08:24:54 +12:00
Stanislav Meduna 808e3be324
Add the display.is_displaying_page condition (#1646)
* display: add the display.is_displaying_page condition

* use maybe_simple_value for page_id

* add test
2021-04-02 23:00:41 -03:00
SenexCrenshaw ac25b138f5
Migrate ESPColor to Color (#1551)
* Migrate ESPColor to Color

* color.h constructor fix

* Updated componets to use Color
Added a using for ESPColor

* Lint fixes

* Fixed value error

* Update display components to use colorutil

* Updated to latest PR comments

* Fixed COLOR_WHITE

* Moved esp_scale to color_utils

* Rename color_utils to display_color_utils
2021-03-02 11:08:57 -03:00
Marcel Feix 4b808611e9
Add GIF Animation Support (#1378)
* Adding GIF Animation Support

* CLang tidy correction

* Adding Codeowner
2020-12-14 13:17:16 -03:00
Guillermo Ruffino a9d75ca4f4
Image bit dephts (#1241) 2020-08-11 15:28:30 +02:00
Keith Burzinski 417a3cdf51
Add SSD1351 OLED display support (#1100)
* Add SSD1351 display support

* Linting round 2

* Updated/rebased for proper Color support

* Fix color image processing
2020-07-09 23:49:26 -03:00
Keith Burzinski 7fa98e288f
SSD1325 grayscale support (#1064)
* SSD1325 grayscale support implemented

* Linted

* Fix garbage on display at power-up

* Rebase

* Linted

* Add brightness control, CS fixes

* Fix up SSD1327 init

* Add turn_on() and turn_off() methods

* Set brightness later in setup(), logging tweak

* Added is_on() method

* Added  grayscale image support

* Updated to use Color, 1327 GS fix
2020-07-09 21:53:49 -03:00
Andrew Zaborowski 2f07225984
Fix: Component script not stopped in certain situations (#1004)
* Move stop/is_running implementation to Action base class

Try to fix issue #1105.  Until now if an UpdateComponentAction, a
LambdaAction, or any action that can contain those inside their
"else" or "then" action lists, resulted in a call to script.stop on
the script that contains them, the script would continue running,
because they didn't implement a stop() method.  Basically only
the asynchronous ones did: DelayAction, WaitUntilAction and
ScriptWaitAction.

With this change num_running_ in Action replaces
DelayAction::num_running_ and WaitUntilAction::triggered_ to provide
the same is_running logic to other actions.

* Make some Action methods protected

Apparently play()/stop() etc. are not meant to be called directly by
users of the class and if they're called directly that would not give
the expected result for the classes that have an empty play().

Make all methods except play_complex, stop_comples and is_running
protected.  While there also make RemoteTransmitterActionBase::encode
protected.

* lint

* format

Co-authored-by: Guillermo Ruffino <glm.net@gmail.com>
2020-06-28 19:44:15 -03:00
Keith Burzinski 491f7e96f0
Add support for ST7789V display module (as on TTGO T-Display) (#1050)
* TFT-LCD ST7789V of ESP32 TTGO.

This patch allows you to use TFT-LCD ST7789V of ESP32 TTGO

* Lots of polish and a few tweaks

* Add test

* Add color to core, take 1

* Where did those tabs come from?

* Fix lines too long

* Added color component

* Linted

* Rebase, SPI fix, test

* Shuffle bits

* One more thing...oops

* Image type fix...oops

* Make display_buffer use Color

* Fix BGR/RGB, remove predefined colors

* Fix all the things

* renamed colors to color

* migrate max7219

Co-authored-by: musk95 <musk95@naver.com>
Co-authored-by: Guillermo Ruffino <glm.net@gmail.com>
2020-06-28 18:37:36 -03:00
Otto Winter 8ff742d9ab
Implement more dump_configs (#791) 2019-10-23 14:43:41 +02:00
Otto Winter 8e75980ebd
Cleanup dashboard JS (#491)
* Cleanup dashboard JS

* Add vscode

* Save start_mark/end_mark

* Updates

* Updates

* Remove need for cv.nameable

It's a bit hacky but removes so much bloat from integrations

* Add enum helper

* Document APIs, and Improvements

* Fixes

* Fixes

* Update PULL_REQUEST_TEMPLATE.md

* Updates

* Updates

* Updates
2019-04-22 21:56:30 +02:00
Otto Winter 6682c43dfa
🏗 Merge C++ into python codebase (#504)
## Description:

Move esphome-core codebase into esphome (and a bunch of other refactors). See https://github.com/esphome/feature-requests/issues/97

Yes this is a shit ton of work and no there's no way to automate it :( But it will be worth it 👍

Progress:
- Core support (file copy etc): 80%
- Base Abstractions (light, switch): ~50%
- Integrations: ~10%
- Working? Yes, (but only with ported components).

Other refactors:
- Moves all codegen related stuff into a single class: `esphome.codegen` (imported as `cg`)
- Rework coroutine syntax
- Move from `component/platform.py` to `domain/component.py` structure as with HA
- Move all defaults out of C++ and into config validation.
- Remove `make_...` helpers from Application class. Reason: Merge conflicts with every single new integration.
- Pointer Variables are stored globally instead of locally in setup(). Reason: stack size limit.

Future work:
- Rework const.py - Move all `CONF_...` into a conf class (usage `conf.UPDATE_INTERVAL` vs `CONF_UPDATE_INTERVAL`). Reason: Less convoluted import block
- Enable loading from `custom_components` folder.

**Related issue (if applicable):** https://github.com/esphome/feature-requests/issues/97

**Pull request in [esphome-docs](https://github.com/esphome/esphome-docs) with documentation (if applicable):** esphome/esphome-docs#<esphome-docs PR number goes here>

## Checklist:
  - [ ] The code change is tested and works locally.
  - [ ] Tests have been added to verify that the new code works (under `tests/` folder).

If user exposed functionality or configuration variables are added/changed:
  - [ ] Documentation added/updated in [esphomedocs](https://github.com/OttoWinter/esphomedocs).
2019-04-17 12:06:00 +02:00