mirror of
https://github.com/esphome/esphome.git
synced 2024-12-25 15:04:54 +01:00
Trying agian but as a component
This commit is contained in:
parent
5f2e4f95e3
commit
0ece074bd6
2 changed files with 44 additions and 45 deletions
|
@ -16,30 +16,22 @@ void VornadoIR::dump_config() { ESP_LOGCONFIG(TAG, "Vornado IR"); }
|
||||||
|
|
||||||
void VornadoIR::send_power_toggle() {
|
void VornadoIR::send_power_toggle() {
|
||||||
ESP_LOGI(TAG, "Sending power toggle request");
|
ESP_LOGI(TAG, "Sending power toggle request");
|
||||||
this->transmit_(TOTO_IR_FIRST_POWER_TIMINGS);
|
this->transmit_(VORNADO_IR_POWER_TOGGLE_TIMINGS);
|
||||||
this->transmit_(TOTO_IR_SECOND_POWER_TIMINGS);
|
|
||||||
this->transmit_(TOTO_IR_THIRD_POWER_TIMINGS);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void VornadoIR::send_change_direction() {
|
void VornadoIR::send_change_direction() {
|
||||||
ESP_LOGI(TAG, "Sending change direction request");
|
ESP_LOGI(TAG, "Sending change direction request");
|
||||||
this->transmit_(TOTO_IR_FIRST_POWER_TIMINGS);
|
this->transmit_(VORNADO_IR_CHANGE_DIRECTION_TIMINGS);
|
||||||
this->transmit_(TOTO_IR_SECOND_POWER_TIMINGS);
|
|
||||||
this->transmit_(TOTO_IR_THIRD_POWER_TIMINGS);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void VornadoIR::send_increase() {
|
void VornadoIR::send_increase() {
|
||||||
ESP_LOGI(TAG, "Sending increase request");
|
ESP_LOGI(TAG, "Sending increase request");
|
||||||
this->transmit_(TOTO_IR_FIRST_POWER_TIMINGS);
|
this->transmit_(VORNADO_IR_INCREASE_TIMINGS);
|
||||||
this->transmit_(TOTO_IR_SECOND_POWER_TIMINGS);
|
|
||||||
this->transmit_(TOTO_IR_THIRD_POWER_TIMINGS);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void VornadoIR::send_decrease() {
|
void VornadoIR::send_decrease() {
|
||||||
ESP_LOGI(TAG, "Sending decrease request");
|
ESP_LOGI(TAG, "Sending decrease request");
|
||||||
this->transmit_(TOTO_IR_FIRST_POWER_TIMINGS);
|
this->transmit_(VORNADO_IR_DECREASE_TIMINGS);
|
||||||
this->transmit_(TOTO_IR_SECOND_POWER_TIMINGS);
|
|
||||||
this->transmit_(TOTO_IR_THIRD_POWER_TIMINGS);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void VornadoIR::transmit_(RawTimings ir_code) {
|
void VornadoIR::transmit_(RawTimings ir_code) {
|
||||||
|
@ -50,7 +42,7 @@ void VornadoIR::transmit_(RawTimings ir_code) {
|
||||||
data->set_data(ir_code);
|
data->set_data(ir_code);
|
||||||
data->set_carrier_frequency(38000);
|
data->set_carrier_frequency(38000);
|
||||||
transmit.set_send_times(3);
|
transmit.set_send_times(3);
|
||||||
transmit.set_send_wait(40000);
|
transmit.set_send_wait(7);
|
||||||
ESP_LOGD(TAG, "Sending ir_code actual perform transmit");
|
ESP_LOGD(TAG, "Sending ir_code actual perform transmit");
|
||||||
transmit.perform();
|
transmit.perform();
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,41 +6,48 @@ namespace esphome {
|
||||||
namespace vornado_ir {
|
namespace vornado_ir {
|
||||||
|
|
||||||
// Power Toggle
|
// Power Toggle
|
||||||
const remote_base::RawTimings TOTO_IR_FIRST_POWER_TIMINGS = {
|
const remote_base::RawTimings VORNADO_IR_POWER_TOGGLE_TIMINGS = {
|
||||||
6020, -3037, 537, -575, 537, -1713, 537, -575, 537, -575, 537, -575, 564, -575, 537, -575, 537,
|
1250, -436, 1250, -435, 405, -1281, 1250, -436, 1249, -436, 405, -1280, 405, -1281, 405, -1281, 405, -1281,
|
||||||
-575, 536, -602, 537, -575, 537, -575, 537, -1713, 537, -576, 536, -576, 560, -552, 560, -578,
|
1250, -436, 405, -1279, 405, -8129, 1252, -435, 1250, -436, 405, -1279, 1251, -436, 1250, -435, 405, -1280,
|
||||||
536, -576, 561, -551, 536, -576, 587, -552, 560, -552, 560, -552, 535, -576, 587, -1664, 536,
|
406, -1281, 405, -1280, 405, -1281, 1251, -435, 404, -1281, 405, -8128, 1251, -436, 1249, -436, 405, -1280,
|
||||||
-576, 536, -1714, 560, -552, 536, -576, 560, -579, 560, -1663, 560, -1691, 536, -1688, 536, -576,
|
1251, -435, 1250, -435, 405, -1281, 405, -1281, 404, -1281, 405, -1281, 1250, -436, 404, -1280, 406, -8127,
|
||||||
562, -1688, 560, -553, 535, -577, 586, -552, 535, -1688, 536, -1715, 560};
|
1251, -436, 1249, -436, 404, -1281, 1250, -436, 1249, -436, 405, -1280, 405, -1281, 405, -1281, 405, -1280,
|
||||||
|
1251, -435, 405, -1280, 405, -8129, 1251, -436, 1250, -436, 404, -1281, 1250, -436, 1249, -437, 404, -1280,
|
||||||
const remote_base::RawTimings TOTO_IR_SECOND_POWER_TIMINGS = {
|
405, -1281, 404, -1281, 405, -1281, 1249, -437, 404, -1281, 405, -8128, 1251, -435, 1249, -437, 404, -1281,
|
||||||
5991, -3037, 560, -552, 537, -1713, 537, -576, 536, -576, 536, -576, 586, -552, 537, -575, 537,
|
1250, -436, 1250, -436, 404, -1280, 405, -1281, 405, -1280, 405, -1281, 1250, -436, 404, -1280, 406};
|
||||||
-575, 537, -575, 587, -552, 560, -552, 536, -1714, 561, -551, 536, -576, 536, -576, 560, -578,
|
|
||||||
536, -576, 560, -552, 536, -576, 536, -603, 560, -552, 559, -552, 537, -576, 562, -1687, 537,
|
|
||||||
-576, 560, -1690, 536, -576, 536, -576, 536, -603, 535, -1688, 536, -1715, 559, -1665, 560, -552,
|
|
||||||
562, -1688, 560, -553, 535, -577, 585, -553, 559, -1665, 559, -1691, 560};
|
|
||||||
|
|
||||||
const remote_base::RawTimings TOTO_IR_THIRD_POWER_TIMINGS = {
|
|
||||||
5992, -3036, 538, -575, 536, -1714, 561, -551, 537, -575, 560, -552, 563, -575, 561, -551, 537,
|
|
||||||
-575, 537, -576, 562, -576, 536, -576, 536, -1714, 537, -575, 537, -575, 536, -576, 536, -603,
|
|
||||||
559, -553, 536, -576, 560, -552, 536, -602, 551, -561, 560, -552, 560, -552, 586, -1664, 536,
|
|
||||||
-576, 536, -1714, 561, -552, 559, -553, 535, -603, 536, -1688, 535, -1715, 560, -1664, 560, -553,
|
|
||||||
561, -1689, 535, -577, 559, -553, 586, -552, 559, -1665, 535, -1715, 560};
|
|
||||||
|
|
||||||
// Start Fans
|
// Start Fans
|
||||||
const remote_base::RawTimings TOTO_IR_FIRST_FAN_TIMINGS = {
|
const remote_base::RawTimings VORNADO_IR_CHANGE_DIRECTION_TIMINGS = {
|
||||||
6019, -3010, 564, -575, 537, -1686, 538, -575, 563, -575, 537, -575, 562, -550, 537, -601, 538,
|
1271, -416, 1269, -417, 423, -1260, 1270, -417, 1268, -416, 424, -1261, 424, -1261, 425, -1262, 423, -1262,
|
||||||
-574, 537, -576, 537, -575, 560, -578, 537, -1686, 538, -575, 563, -575, 561, -551, 537, -575,
|
424, -1263, 423, -1261, 1269, -7265, 1270, -417, 1268, -417, 424, -1262, 1269, -418, 1268, -418, 423, -1261,
|
||||||
537, -575, 563, -576, 536, -576, 536, -576, 536, -576, 563, -575, 560, -552, 536, -1714, 537,
|
424, -1264, 422, -1263, 423, -1262, 424, -1262, 424, -1262, 1269, -7263, 1270, -418, 1268, -418, 422, -1261,
|
||||||
-1687, 537, -575, 561, -578, 560, -552, 560, -552, 536, -576, 587, -552, 535, -1688, 536, -1714,
|
1269, -418, 1267, -419, 421, -1263, 423, -1263, 423, -1261, 424, -1263, 401, -1284, 423, -1262, 1269, -7264,
|
||||||
537, -576, 560, -552, 559, -579, 536, -576, 536, -576, 536, -576, 536};
|
1248, -440, 1265, -420, 420, -1265, 1247, -440, 1245, -439, 401, -1284, 423, -1264, 421, -1264, 402, -1283,
|
||||||
|
402, -1285, 401, -1283, 1247, -7285, 1269, -419, 1247, -438, 402, -1283, 1247, -439, 1246, -440, 400, -1284,
|
||||||
|
402, -1284, 402, -1283, 403, -1283, 402, -1284, 402, -1285, 1247, -7286, 1249, -439, 1246, -439, 401, -1284,
|
||||||
|
1247, -438, 1247, -439, 401, -1284, 402, -1284, 402, -1285, 401, -1283, 403, -1284, 401, -1284, 1247, -7285,
|
||||||
|
1269, -418, 1266, -444, 376, -1284, 1266, -420, 1266, -419, 400, -1285, 423, -1263, 423, -1262, 423, -1263,
|
||||||
|
422, -1264, 422, -1263, 1268};
|
||||||
|
|
||||||
const remote_base::RawTimings TOTO_IR_SECOND_FAN_TIMINGS = {
|
const remote_base::RawTimings VORNADO_IR_INCREASE_TIMINGS = {
|
||||||
6017, -3036, 538, -574, 538, -1686, 564, -574, 538, -574, 562, -550, 538, -575, 563, -575, 537,
|
1271, -417, 1268, -417, 423, -1261, 1270, -417, 1269, -415, 1270, -418, 422, -1262, 424, -1262, 424, -1262,
|
||||||
-575, 561, -551, 537, -602, 561, -550, 537, -1687, 537, -602, 537, -575, 561, -551, 561, -551,
|
1269, -442, 1244, -417, 424, -8109, 1272, -416, 1270, -417, 423, -1261, 1270, -441, 1244, -418, 1268, -441,
|
||||||
536, -602, 537, -575, 537, -575, 537, -575, 563, -576, 536, -576, 536, -576, 536, -1714, 560,
|
399, -1262, 424, -1261, 424, -1263, 1269, -417, 1268, -417, 423, -8109, 1270, -418, 1268, -417, 423, -1261,
|
||||||
-1664, 536, -603, 536, -576, 560, -551, 537, -575, 561, -578, 536, -576, 536, -1688, 562, -1688,
|
1270, -417, 1268, -416, 1270, -416, 424, -1262, 424, -1261, 424, -1260, 1270, -418, 1267, -418, 423, -8109,
|
||||||
536, -576, 560, -552, 563, -576, 560, -552, 560, -551, 536, -577, 586};
|
1270, -419, 1267, -419, 422, -1261, 1269, -418, 1267, -417, 1269, -441, 399, -1261, 424, -1261, 424, -1262,
|
||||||
|
1268, -418, 1267, -417, 422, -8108, 1269, -418, 1267, -417, 423, -1262, 1268, -418, 1267, -442, 1242, -419,
|
||||||
|
422, -1261, 423, -1262, 424, -1262, 1268, -419, 1267, -418, 422, -8108, 1270, -418, 1267, -419, 422, -1261,
|
||||||
|
1269, -420, 1265, -418, 1268, -418, 422, -1262, 424, -1261, 424, -1262, 1268, -419, 1267, -418, 422};
|
||||||
|
|
||||||
|
const remote_base::RawTimings VORNADO_IR_DECREASE_TIMINGS = {
|
||||||
|
1270, -417, 1269, -442, 398, -1262, 1269, -442, 1244, -442, 398, -1262, 424, -1262, 424, -1262, 424, -1262,
|
||||||
|
424, -1261, 1269, -443, 398, -8108, 1272, -417, 1269, -442, 398, -1262, 1270, -442, 1243, -442, 398, -1260,
|
||||||
|
426, -1261, 425, -1261, 424, -1261, 424, -1262, 1268, -442, 398, -8106, 1271, -442, 1243, -442, 398, -1262,
|
||||||
|
1268, -443, 1242, -417, 424, -1261, 425, -1261, 424, -1260, 425, -1261, 425, -1262, 1268, -418, 422, -8108,
|
||||||
|
1271, -442, 1243, -442, 398, -1262, 1268, -418, 1268, -442, 398, -1262, 423, -1262, 424, -1261, 424, -1261,
|
||||||
|
425, -1262, 1267, -418, 423, -8106, 1271, -417, 1269, -419, 421, -1261, 1269, -443, 1243, -442, 398, -1261,
|
||||||
|
424, -1261, 424, -1261, 424, -1262, 423, -1263, 1267, -443, 398, -8106, 1271, -442, 1242, -419, 422, -1261,
|
||||||
|
1268, -443, 1242, -443, 397, -1262, 423, -1263, 423, -1263, 422, -1261, 424, -1262, 1268, -443, 397};
|
||||||
|
|
||||||
} // namespace vornado_ir
|
} // namespace vornado_ir
|
||||||
} // namespace esphome
|
} // namespace esphome
|
||||||
|
|
Loading…
Reference in a new issue