-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove magic numbers, Add custom command set option
- Loading branch information
1 parent
232d5eb
commit cc5ab2b
Showing
13 changed files
with
107 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
#pragma once | ||
#include <stdint.h> | ||
#include <vector> | ||
|
||
namespace esphome | ||
{ | ||
namespace philips_series_2200 | ||
{ | ||
#if defined(PHILIPS_EP2220) | ||
#define USE_DEFAULT_PHILIPS_COMMAND_SET | ||
#else | ||
#define USE_DEFAULT_PHILIPS_COMMAND_SET | ||
#endif | ||
|
||
#ifdef USE_DEFAULT_PHILIPS_COMMAND_SET | ||
const uint8_t message_header[2] = {0xD5, 0x55}; | ||
const uint8_t led_off = 0x00; | ||
const uint8_t led_half = 0x03; | ||
const uint8_t led_on = 0x07; | ||
const uint8_t led_second = 0x38; | ||
const uint8_t led_third = 0x3F; | ||
|
||
const std::vector<uint8_t> command_pre_power_on = | ||
{0xD5, 0x55, 0x0A, 0x01, 0x02, 0x00, 0x02, 0x00, 0x00, 0x00, 0x0E, 0x12}; | ||
const std::vector<uint8_t> command_power_with_cleaning = | ||
{0xD5, 0x55, 0x02, 0x01, 0x02, 0x00, 0x02, 0x00, 0x00, 0x00, 0x38, 0x15}; | ||
const std::vector<uint8_t> command_power_without_cleaning = | ||
{0xD5, 0x55, 0x01, 0x01, 0x02, 0x00, 0x02, 0x00, 0x00, 0x00, 0x25, 0x27}; | ||
const std::vector<uint8_t> command_power_off = | ||
{0xD5, 0x55, 0x00, 0x01, 0x02, 0x00, 0x02, 0x01, 0x00, 0x00, 0x1D, 0x3B}; | ||
const std::vector<uint8_t> command_press_play_pause = | ||
{0xD5, 0x55, 0x00, 0x01, 0x02, 0x00, 0x02, 0x00, 0x00, 0x01, 0x19, 0x32}; | ||
const std::vector<uint8_t> command_press_coffee = | ||
{0xD5, 0x55, 0x00, 0x01, 0x02, 0x00, 0x02, 0x08, 0x00, 0x00, 0x39, 0x1C}; | ||
const std::vector<uint8_t> command_press_espresso = | ||
{0xD5, 0x55, 0x00, 0x01, 0x02, 0x00, 0x02, 0x02, 0x00, 0x00, 0x09, 0x2D}; | ||
const std::vector<uint8_t> command_press_hot_water = | ||
{0xD5, 0x55, 0x00, 0x01, 0x02, 0x00, 0x02, 0x04, 0x00, 0x00, 0x21, 0x01}; | ||
const std::vector<uint8_t> command_press_steam = | ||
{0xD5, 0x55, 0x00, 0x01, 0x02, 0x00, 0x02, 0x10, 0x00, 0x00, 0x09, 0x26}; | ||
const std::vector<uint8_t> command_press_bean = | ||
{0xD5, 0x55, 0x00, 0x01, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x09, 0x2F}; | ||
const std::vector<uint8_t> command_press_size = | ||
{0xD5, 0x55, 0x00, 0x01, 0x02, 0x00, 0x02, 0x00, 0x04, 0x00, 0x20, 0x05}; | ||
const std::vector<uint8_t> command_press_aqua_clean = | ||
{0xD5, 0x55, 0x00, 0x01, 0x02, 0x00, 0x02, 0x00, 0x10, 0x00, 0x0D, 0x36}; | ||
const std::vector<uint8_t> command_press_calc_clean = | ||
{0xD5, 0x55, 0x00, 0x01, 0x02, 0x00, 0x02, 0x00, 0x20, 0x00, 0x28, 0x37}; | ||
#endif | ||
} // namespace philips_series_2200 | ||
} // namespace esphome |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.