ESPHome  2024.10.2
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 // Which temperature to use as the climate entity's current temperature reading
45  // Use the temperature of the air the BedJet is putting out
47  // Use the ambient temperature of the room the BedJet is in
49 };
50 
51 enum BedjetButton : uint8_t {
53  BTN_OFF = 0x1,
55  BTN_COOL = 0x2,
57  BTN_HEAT = 0x3,
59  BTN_TURBO = 0x4,
61  BTN_DRY = 0x5,
63  BTN_EXTHT = 0x6,
64 
66  BTN_M1 = 0x20,
68  BTN_M2 = 0x21,
70  BTN_M3 = 0x22,
71 
72  /* These are "MAGIC" buttons */
73 
80  MAGIC_UPDATE = 0x43,
83 };
84 
85 enum BedjetCommand : uint8_t {
86  CMD_BUTTON = 0x1,
88  CMD_SET_TEMP = 0x3,
89  CMD_STATUS = 0x6,
90  CMD_SET_FAN = 0x7,
92 };
93 
94 #define BEDJET_FAN_STEP_NAMES_ \
95  { \
96  "5%", "10%", "15%", "20%", "25%", "30%", "35%", "40%", "45%", "50%", "55%", "60%", "65%", "70%", "75%", "80%", \
97  "85%", "90%", "95%", "100%" \
98  }
99 
100 static const uint8_t BEDJET_FAN_SPEED_COUNT = 20;
101 
102 static const char *const BEDJET_FAN_STEP_NAMES[BEDJET_FAN_SPEED_COUNT] = BEDJET_FAN_STEP_NAMES_;
103 static const std::string BEDJET_FAN_STEP_NAME_STRINGS[BEDJET_FAN_SPEED_COUNT] = BEDJET_FAN_STEP_NAMES_;
104 static const std::set<std::string> BEDJET_FAN_STEP_NAMES_SET BEDJET_FAN_STEP_NAMES_;
105 
106 } // namespace bedjet
107 } // namespace esphome
Enter Cool mode (fan only)
Definition: bedjet_const.h:55
Start the M2 biorhythm/preset program.
Definition: bedjet_const.h:68
Enter Extended Heat mode (limited to 10 hours)
Definition: bedjet_const.h:63
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:57
BedJet is in "wait" mode, a step during a biorhythm program.
Definition: bedjet_const.h:32
Turn BedJet off.
Definition: bedjet_const.h:53
BedJet is in Dry mode (high speed, no heat)
Definition: bedjet_const.h:30
Turn debug mode on/off.
Definition: bedjet_const.h:75
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:61
Start the M1 biorhythm/preset program.
Definition: bedjet_const.h:66
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:70
BedJet is in Turbo mode (high heat, limited time)
Definition: bedjet_const.h:24
Acknowledge notification handled. See BedjetNotify.
Definition: bedjet_const.h:82
BedjetHeatMode
Optional heating strategies to use for climate::CLIMATE_MODE_HEAT.
Definition: bedjet_const.h:36
Implementation of SPI Controller mode.
Definition: a01nyub.cpp:7
Perform a connection test.
Definition: bedjet_const.h:78
Enter Turbo mode (high heat, limited to 10 minutes)
Definition: bedjet_const.h:59
Request a firmware update. This will also restart the Bedjet.
Definition: bedjet_const.h:80
HVACMode.HEAT is handled using BTN_HEAT (default)
Definition: bedjet_const.h:38