8000
Skip to content

Fix time period validation for the auto cleaning interval - #4811

Merged
jesserockz merged 1 commit into
esphome:devfrom
fgsch:patch-1
May 15, 2023
Merged

Fix time period validation for the auto cleaning interval#4811
jesserockz merged 1 commit into
esphome:devfrom
fgsch:patch-1

Conversation

@fgsch
@fgsch fgsch commented May 12, 2023
Copy link
Copy Markdown
Contributor

What does this implement/fix?

Correct validator to fix the AttributeError: 'OrderedDict' object has no attribute 'microseconds' error when adding the auto_cleaning_interval entity to the sensor.

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#4507

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

Test Environment

  • ESP32
  • ESP32 IDF
  • ESP8266
  • RP2040

Example entry for config.yaml:

esphome:
  name: test
  friendly_name: test

esp32:
  board: esp32dev
  framework:
    type: arduino

logger:

api:
  encryption:
    key: "foobar"

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

i2c:
  sda: GPIO6
  scl: GPIO7
  
sensor:
  - platform: sen5x
    auto_cleaning_interval: 604800s

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:

@fgsch
fgsch marked this pull request as ready for review May 15, 2023 21:41
@fgsch
fgsch requested a review from martgras as a code owner May 15, 2023 21:41
@probot-esphome
Copy link
Copy Markdown

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

@jesserockz jesserockz added this to the 2023.5.0b4 milestone May 15, 2023
@jesserockz
jesserockz merged commit 8e4aeec into esphome:dev May 15, 2023
@jesserockz jesserockz mentioned this pull request May 15, 2023
@fgsch
fgsch deleted the patch-1 branch May 16, 2023 10:51
@jesserockz jesserockz mentioned this pull request May 17, 2023
@github-actions github-actions Bot locked and limited conversation to collaborators May 18, 2023
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.

AttributeError: 'OrderedDict' object has no attribute 'microseconds'

3 participants

0