ESPHome  2022.9.1
bedjet_const.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <set>
4 
5 namespace esphome {
6 namespace bedjet {
7 
8 static const char *const TAG = "bedjet";
9 
11 inline static uint8_t bedjet_fan_step_to_speed(const uint8_t fan) {
12  // 0 = 5%
13  // 19 = 100%
14  return 5 * fan + 5;
15 }
16 inline static uint8_t bedjet_fan_speed_to_index(const uint8_t speed) { return speed / 5 - 1; }
17 
18 enum BedjetMode : uint8_t {
22  MODE_HEAT = 1,
28  MODE_COOL = 4,
30  MODE_DRY = 5,
32  MODE_WAIT = 6,
33 };
34 
41 };
42 
43 enum BedjetButton : uint8_t {
45  BTN_OFF = 0x1,
47  BTN_COOL = 0x2,
49  BTN_HEAT = 0x3,
51  BTN_TURBO = 0x4,
53  BTN_DRY = 0x5,
55  BTN_EXTHT = 0x6,
56 
58  BTN_M1 = 0x20,
60  BTN_M2 = 0x21,
62  BTN_M3 = 0x22,
63 
64  /* These are "MAGIC" buttons */
65 
72  MAGIC_UPDATE = 0x43,
75 };
76 
77 enum BedjetCommand : uint8_t {
78  CMD_BUTTON = 0x1,
80  CMD_SET_TEMP = 0x3,
81  CMD_STATUS = 0x6,
82  CMD_SET_FAN = 0x7,
84 };
85 
86 #define BEDJET_FAN_STEP_NAMES_ \
87  { \
88  "5%", "10%", "15%", "20%", "25%", "30%", "35%", "40%", "45%", "50%", "55%", "60%", "65%", "70%", "75%", "80%", \
89  "85%", "90%", "95%", "100%" \
90  }
91 
92 static const uint8_t BEDJET_FAN_SPEED_COUNT = 20;
93 
94 static const char *const BEDJET_FAN_STEP_NAMES[BEDJET_FAN_SPEED_COUNT] = BEDJET_FAN_STEP_NAMES_;
95 static const std::string BEDJET_FAN_STEP_NAME_STRINGS[BEDJET_FAN_SPEED_COUNT] = BEDJET_FAN_STEP_NAMES_;
96 static const std::set<std::string> BEDJET_FAN_STEP_NAMES_SET BEDJET_FAN_STEP_NAMES_;
97 
98 } // namespace bedjet
99 } // namespace esphome
Enter Cool mode (fan only)
Definition: bedjet_const.h:47
Start the M2 biorhythm/preset program.
Definition: bedjet_const.h:60
Enter Extended Heat mode (limited to 10 hours)
Definition: bedjet_const.h:55
BedJet is in Extended Heat mode (limited to 10 hours)
Definition: bedjet_const.h:26
int speed
Definition: fan.h:35
Enter Heat mode (limited to 4 hours)
Definition: bedjet_const.h:49
BedJet is in "wait" mode, a step during a biorhythm program.
Definition: bedjet_const.h:32
Turn BedJet off.
Definition: bedjet_const.h:45
BedJet is in Dry mode (high speed, no heat)
Definition: bedjet_const.h:30
Turn debug mode on/off.
Definition: bedjet_const.h:67
BedJet is in Cool mode (actually "Fan only" mode)
Definition: bedjet_const.h:28
Enter Dry mode (high speed, no heat)
Definition: bedjet_const.h:53
Start the M1 biorhythm/preset program.
Definition: bedjet_const.h:58
HVACMode.HEAT is handled using BTN_EXTHT.
Definition: bedjet_const.h:40
BedJet is in Heat mode (limited to 4 hours)
Definition: bedjet_const.h:22
Start the M3 biorhythm/preset program.
Definition: bedjet_const.h:62
BedJet is in Turbo mode (high heat, limited time)
Definition: bedjet_const.h:24
Acknowledge notification handled. See BedjetNotify.
Definition: bedjet_const.h:74
BedjetHeatMode
Optional heating strategies to use for climate::CLIMATE_MODE_HEAT.
Definition: bedjet_const.h:36
Definition: a4988.cpp:4
Perform a connection test.
Definition: bedjet_const.h:70
Enter Turbo mode (high heat, limited to 10 minutes)
Definition: bedjet_const.h:51
Request a firmware update. This will also restart the Bedjet.
Definition: bedjet_const.h:72
HVACMode.HEAT is handled using BTN_HEAT (default)
Definition: bedjet_const.h:38