Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix graph hangs when y <= 0 #6593

Merged
merged 6 commits into from
Apr 25, 2024
Merged

Fix graph hangs when y <= 0 #6593

merged 6 commits into from
Apr 25, 2024

Conversation

chiahsing
Copy link
Contributor

What does this implement/fix?

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Other

Related issue or feature (if applicable): fixes esphome/issues#5703

Pull request in esphome-docs with documentation (if applicable): esphome/esphome-docs#

Test Environment

  • ESP32
  • ESP32 IDF
  • ESP8266
  • RP2040
  • BK72xx
  • RTL87xx

Example entry for config.yaml:

esphome:
  name: nodemcu-32

logger:

network:

ota:

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password
  fast_connect: true

api:
  encryption:
    key: !secret api_key

esp32:
  board: esp32dev

spi:
  mosi_pin: GPIO23
  clk_pin: GPIO18

debug:
  update_interval: 5s

sensor:
  - platform: uptime
    id: uptime_sensor
    update_interval: 1s
  - platform: template
    id: template_sensor
    update_interval: 1s
    lambda: |-
      return static_cast<int>(id(uptime_sensor).state) % 16;

graph:
  - id: template_graph
    duration: 1min
    width: 100
    height: 100
    x_grid: 15s
    y_grid: 5
    min_value: 0
    max_value: 15
    traces:
      - sensor: template_sensor
        continuous: true

display:
  - platform: waveshare_epaper
    cs_pin: GPIO26
    dc_pin: GPIO27
    model: 2.13inv3
    update_interval: 1s
    lambda: |-
      it.graph(0, 0, id(template_graph));

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:

@probot-esphome
Copy link

Hey there @synco, mind taking a look at this pull request as it has been labeled with an integration (graph) you are listed as a code owner for? Thanks!
(message by CodeOwnersMention)

@codecov-commenter
Copy link

codecov-commenter commented Apr 20, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 53.45%. Comparing base (4d8b5ed) to head (3123fa2).
Report is 470 commits behind head on dev.

Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #6593      +/-   ##
==========================================
- Coverage   53.70%   53.45%   -0.26%     
==========================================
  Files          50       50              
  Lines        9408     9543     +135     
  Branches     1654     1685      +31     
==========================================
+ Hits         5053     5101      +48     
- Misses       4056     4131      +75     
- Partials      299      311      +12     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@chiahsing
Copy link
Contributor Author

Fixed the test failures. PTAL

@jesserockz jesserockz merged commit de2a92e into esphome:dev Apr 25, 2024
55 checks passed
@chiahsing chiahsing deleted the graph branch April 26, 2024 10:44
@github-actions github-actions bot locked and limited conversation to collaborators Apr 28, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Device crashes when the graph drawing a line from outside to inside
4 participants