mirror of
https://github.com/esphome/esphome.git
synced 2024-12-24 14:34:54 +01:00
pulse_counter_ulp: Fix enum case
This commit is contained in:
parent
ad3b75601e
commit
1feb0bf8cb
3 changed files with 7 additions and 7 deletions
|
@ -14,11 +14,11 @@ static const char *const TAG = "pulse_counter_ulp";
|
|||
namespace {
|
||||
const char *to_string(CountMode count_mode) {
|
||||
switch (count_mode) {
|
||||
case CountMode::disable:
|
||||
case CountMode::DISABLE:
|
||||
return "disable";
|
||||
case CountMode::increment:
|
||||
case CountMode::INCREMENT:
|
||||
return "increment";
|
||||
case CountMode::decrement:
|
||||
case CountMode::DECREMENT:
|
||||
return "decrement";
|
||||
}
|
||||
return "UNKNOWN MODE";
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
namespace esphome {
|
||||
namespace pulse_counter_ulp {
|
||||
|
||||
enum class CountMode { disable = 0, increment = 1, decrement = -1 };
|
||||
enum class CountMode { DISABLE = 0, INCREMENT = 1, DECREMENT = -1 };
|
||||
|
||||
using clock = std::chrono::steady_clock;
|
||||
using microseconds = std::chrono::duration<uint32_t, std::micro>;
|
||||
|
|
|
@ -19,9 +19,9 @@ from esphome.const import (
|
|||
pulse_counter_ulp_ns = cg.esphome_ns.namespace("pulse_counter_ulp")
|
||||
CountMode = pulse_counter_ulp_ns.enum("CountMode", is_class=True)
|
||||
COUNT_MODES = {
|
||||
"DISABLE": CountMode.disable,
|
||||
"INCREMENT": CountMode.increment,
|
||||
"DECREMENT": CountMode.decrement,
|
||||
"DISABLE": CountMode.DISABLE,
|
||||
"INCREMENT": CountMode.INCREMENT,
|
||||
"DECREMENT": CountMode.DECREMENT,
|
||||
}
|
||||
|
||||
COUNT_MODE_SCHEMA = cv.enum(COUNT_MODES, upper=True)
|
||||
|
|
Loading…
Reference in a new issue