-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathschedule-test.yaml
122 lines (109 loc) · 3.62 KB
/
schedule-test.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
esphome:
name: "schedule-test"
esp32:
board: esp32dev
framework:
type: arduino
# type: esp-idf
# version: recommended
api:
password: !secret api_password
ota:
password: !secret ota_password
debug:
update_interval: 5s
text_sensor:
- platform: debug
device:
name: "Device Info"
reset_reason:
name: "Reset Reason"
logger:
# Enable fallback hotspot (captive portal) in case wifi connection fails
level: DEBUG
logs:
api: DEBUG
homeassistant: DEBUG
nextion: DEBUG
api.service: DEBUG
sensor: DEBUG
scheduler: DEBUG
dallas: DEBUG
i2c: DEBUG
ext_eeprom: DEBUG
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Esphome-Web-C34484"
password: "hlVBVePNuBE3"
captive_portal:
uart:
rx_pin: GPIO16
tx_pin: GPIO17
baud_rate: 115200
time:
- platform: homeassistant
id: homeassistant_time
i2c:
sda: GPIO21
scl: GPIO22
scan: true
id: bus_1
external_components:
- source: github://pebblebed-tech/esphome@add-serial-EEPROM-feature
components: [ external_eeprom ]
external_eeprom:
id: ext_eeprom_component_1
address: 0x57
ee_memory_type: 24XX32
i2c_buffer_size: 128
i2c_id: bus_1
globals:
- id: my_global_int
type: int
restore_value: yes
initial_value: '0'
- id: my_global_string
type: int[5]
restore_value: yes
initial_value: '{0,1,2,3,4}'
switch:
- platform: template
name: "Test EEPROM Switch"
id: "test_ee_switch"
turn_on_action:
- globals.set:
id: my_global_int
value: '10'
- lambda: |-
uint8_t myValue1 = 42;
ext_eeprom_component_1->write8(15, myValue1);
uint8_t myRdValue1;
myRdValue1 = ext_eeprom_component_1->read8(15);
ESP_LOGD("Eeprom", "I read: %d",myRdValue1 );
int32_t myValue2 = -480;
ext_eeprom_component_1->write_object(10, myValue2); //(location, data)
int32_t myRead2;
ext_eeprom_component_1->read_object(10, myRead2); //location to read, thing to put data into
ESP_LOGD("Eeprom", "I read: %d",myRead2 );
float myValue3 = -78.35;
ext_eeprom_component_1->write_object(20, myValue3); //(location, data)
float myRead3;
ext_eeprom_component_1->read_object(20, myRead3); //location to read, thing to put data into
ESP_LOGD("Eeprom","I read: %f",myRead3);
std::string myString = "This is a test of a very long string This is a test of a very long string This is a test of a very long string This is a test of a very long string This is a test of a very long string This is a test of a very long string ";
ext_eeprom_component_1->write_string_to_eeprom(40, myString); //(location, data)
std::string myRead4;
ext_eeprom_component_1->read_string_from_eeprom(40, myRead4); //location to read, thing to put data into
ESP_LOGD("Eeprom","I read: %s",myRead4.c_str());
ext_eeprom_component_1->write8(0, 0);
ext_eeprom_component_1->write8(1, 1);
ext_eeprom_component_1->write8(2, 2);
ext_eeprom_component_1->write8(3, 3);
ext_eeprom_component_1->write8(4, 4);
ext_eeprom_component_1->write8(5, 5);
ext_eeprom_component_1->write8(6, 6);
ext_eeprom_component_1->write8(7, 7);
ext_eeprom_component_1->dump_eeprom(0,8);