19 #include <esp_gattc_api.h> 116 void loop()
override;
119 void setup()
override { this->
codec_ = make_unique<BedjetCodec>(); }
124 if (this->
name_.empty()) {
134 esp_ble_gattc_cb_param_t *param)
override;
void set_name_(const std::string &name)
bool button_dry()
Press the DRY button.
void dispatch_state_(bool is_ready)
void set_time_id(time::RealTimeClock *time_id)
Set the time::RealTimeClock implementation.
void setup_time_()
Initializes time sync callbacks to support syncing current time to the BedJet.
uint8_t write_bedjet_packet_(BedjetPacket *pkt)
Send the BedjetPacket to the device.
std::unique_ptr< BedjetCodec > codec_
uint8_t get_fan_index()
Return the fan speed index, in the range 0-19.
The RealTimeClock class exposes common timekeeping functions via the device's local real-time clock...
bool button_ext_heat()
Press the EXT HT button.
uint16_t char_handle_status_
const BedjetStatusPacket * get_status_packet() const
void send_local_time()
Attempts to sync the local time (via time_id) to the BedJet device.
static const uint32_t MIN_NOTIFY_THROTTLE
void upgrade_firmware()
Attempts to check for and apply firmware updates.
This class simplifies creating components that periodically check a state.
bool button_memory1()
Press the M1 (memory recall) button.
The format of a BedJet V3 status packet.
void dump_config() override
std::string address_str() const
uint16_t char_handle_name_
Hub component connecting to the BedJet device over Bluetooth.
uint8_t set_notify_(bool enable)
Configures the local ESP BLE client to register (true) or unregister (false) for status notifications...
bool button_heat()
Press the HEAT button.
float get_setup_priority() const override
static const uint32_t DEFAULT_STATUS_TIMEOUT
bool button_memory2()
Press the M2 (memory recall) button.
void gattc_event_handler(esp_gattc_cb_event_t event, esp_gatt_if_t gattc_if, esp_ble_gattc_cb_param_t *param) override
bool button_memory3()
Press the M3 (memory recall) button.
bool set_fan_speed(uint8_t fan_speed_pct)
Set the fan speed to a percent in the range 5% - 100%, at 5% increments.
void status_packet_ready_()
bool button_turbo()
Press the TURBO button.
std::vector< BedJetClient * > children_
bool set_time_remaining(uint8_t hours, uint8_t mins)
Set the operational runtime remaining.
bool set_target_temp(float temp_c)
Set the target temperature to temp_c in °C.
uint8_t get_fan_speed()
Return the fan speed as a percent in the range 5%-100%.
bool send_button(BedjetButton button)
Send the button.
uint16_t get_time_remaining()
Return the remaining runtime, in seconds.
void set_clock(uint8_t hour, uint8_t minute)
Attempt to set the BedJet device's clock to the specified time.
uint16_t config_descr_status_
uint16_t char_handle_cmd_
bool set_fan_index(uint8_t fan_speed_index)
Set the fan speed to a stepped index in the range 0-19.
Implementation of SPI Controller mode.
static ESPBTUUID from_raw(const uint8_t *data)
time::RealTimeClock * time_id_
uint8_t write_notify_config_descriptor_(bool enable)
Reimplementation of BLEClient.gattc_event_handler() for ESP_GATTC_REG_FOR_NOTIFY_EVT.
void set_status_timeout(uint32_t timeout)
Set the status timeout.
bool discover_characteristics_()
bool button_cool()
Press the COOL button.
void register_child(BedJetClient *obj)
Register a BedJetClient child component.
bool button_off()
Press the OFF button.
static const uint32_t NOTIFY_WARN_THRESHOLD
espbt::ClientState node_state