mirror of
https://github.com/esphome/esphome.git
synced 2024-11-28 09:44:12 +01:00
Merge branch 'dev' into dev
This commit is contained in:
commit
7527f84f5c
55 changed files with 213 additions and 480 deletions
|
@ -631,7 +631,7 @@ void EthernetComponent::write_phy_register_(esp_eth_mac_t *mac, PHYRegister regi
|
|||
ESPHL_ERROR_CHECK(err, "Writing PHY Register failed");
|
||||
|
||||
if (this->type_ == ETHERNET_TYPE_RTL8201 && register_data.page) {
|
||||
ESP_LOGD(TAG, "Select PHY Register Page 0x%02" PRIX32, 0x0);
|
||||
ESP_LOGD(TAG, "Select PHY Register Page 0x00");
|
||||
err = mac->write_phy_reg(mac, this->phy_addr_, eth_phy_psr_reg_addr, 0x0);
|
||||
ESPHL_ERROR_CHECK(err, "Select PHY Register Page 0 failed");
|
||||
}
|
||||
|
|
|
@ -60,7 +60,7 @@ void HOT IRAM_ATTR GPIOOneWireBus::write_bit_(bool bit) {
|
|||
// recovery time: t_rec: min=1µs
|
||||
// ds18b20 appears to read the bus after roughly 14µs
|
||||
uint32_t delay0 = bit ? 6 : 60;
|
||||
uint32_t delay1 = bit ? 54 : 5;
|
||||
uint32_t delay1 = bit ? 59 : 5;
|
||||
|
||||
// delay A/C
|
||||
delayMicroseconds(delay0);
|
||||
|
|
|
@ -34,8 +34,8 @@ void ILI9XXXDisplay::setup() {
|
|||
ESP_LOGD(TAG, "Setting up ILI9xxx");
|
||||
|
||||
this->setup_pins_();
|
||||
this->init_lcd_(this->init_sequence_);
|
||||
this->init_lcd_(this->extra_init_sequence_.data());
|
||||
this->init_lcd(this->init_sequence_);
|
||||
this->init_lcd(this->extra_init_sequence_.data());
|
||||
switch (this->pixel_mode_) {
|
||||
case PIXEL_MODE_16:
|
||||
if (this->is_18bitdisplay_) {
|
||||
|
@ -405,7 +405,7 @@ void ILI9XXXDisplay::reset_() {
|
|||
}
|
||||
}
|
||||
|
||||
void ILI9XXXDisplay::init_lcd_(const uint8_t *addr) {
|
||||
void ILI9XXXDisplay::init_lcd(const uint8_t *addr) {
|
||||
if (addr == nullptr)
|
||||
return;
|
||||
uint8_t cmd, x, num_args;
|
||||
|
@ -427,6 +427,20 @@ void ILI9XXXDisplay::init_lcd_(const uint8_t *addr) {
|
|||
}
|
||||
}
|
||||
|
||||
void ILI9XXXGC9A01A::init_lcd(const uint8_t *addr) {
|
||||
if (addr == nullptr)
|
||||
return;
|
||||
uint8_t cmd, x, num_args;
|
||||
while ((cmd = *addr++) != 0) {
|
||||
x = *addr++;
|
||||
num_args = x & 0x7F;
|
||||
this->send_command(cmd, addr, num_args);
|
||||
addr += num_args;
|
||||
if (x & 0x80)
|
||||
delay(150); // NOLINT
|
||||
}
|
||||
}
|
||||
|
||||
// Tell the display controller where we want to draw pixels.
|
||||
void ILI9XXXDisplay::set_addr_window_(uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2) {
|
||||
x1 += this->offset_x_;
|
||||
|
|
|
@ -109,7 +109,7 @@ class ILI9XXXDisplay : public display::DisplayBuffer,
|
|||
|
||||
virtual void set_madctl();
|
||||
void display_();
|
||||
void init_lcd_(const uint8_t *addr);
|
||||
virtual void init_lcd(const uint8_t *addr);
|
||||
void set_addr_window_(uint16_t x, uint16_t y, uint16_t x2, uint16_t y2);
|
||||
void reset_();
|
||||
|
||||
|
@ -269,6 +269,7 @@ class ILI9XXXS3BoxLite : public ILI9XXXDisplay {
|
|||
class ILI9XXXGC9A01A : public ILI9XXXDisplay {
|
||||
public:
|
||||
ILI9XXXGC9A01A() : ILI9XXXDisplay(INITCMD_GC9A01A, 240, 240, true) {}
|
||||
void init_lcd(const uint8_t *addr) override;
|
||||
};
|
||||
|
||||
//----------- ILI9XXX_24_TFT display --------------
|
||||
|
|
|
@ -6,12 +6,12 @@
|
|||
#include "mqtt_const.h"
|
||||
|
||||
#ifdef USE_MQTT
|
||||
#ifdef USE_DATETIME_TIME
|
||||
#ifdef USE_DATETIME_DATETIME
|
||||
|
||||
namespace esphome {
|
||||
namespace mqtt {
|
||||
|
||||
static const char *const TAG = "mqtt.datetime.time";
|
||||
static const char *const TAG = "mqtt.datetime.datetime";
|
||||
|
||||
using namespace esphome::datetime;
|
||||
|
||||
|
@ -80,5 +80,5 @@ bool MQTTDateTimeComponent::publish_state(uint16_t year, uint8_t month, uint8_t
|
|||
} // namespace mqtt
|
||||
} // namespace esphome
|
||||
|
||||
#endif // USE_DATETIME_TIME
|
||||
#endif // USE_DATETIME_DATETIME
|
||||
#endif // USE_MQTT
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#include "esphome/core/defines.h"
|
||||
|
||||
#ifdef USE_MQTT
|
||||
#ifdef USE_DATETIME_TIME
|
||||
#ifdef USE_DATETIME_DATETIME
|
||||
|
||||
#include "esphome/components/datetime/datetime_entity.h"
|
||||
#include "mqtt_component.h"
|
||||
|
@ -17,7 +17,7 @@ class MQTTDateTimeComponent : public mqtt::MQTTComponent {
|
|||
*
|
||||
* @param time The time entity.
|
||||
*/
|
||||
explicit MQTTDateTimeComponent(datetime::DateTimeEntity *time);
|
||||
explicit MQTTDateTimeComponent(datetime::DateTimeEntity *datetime);
|
||||
|
||||
// ========== INTERNAL METHODS ==========
|
||||
// (In most use cases you won't need these)
|
||||
|
@ -41,5 +41,5 @@ class MQTTDateTimeComponent : public mqtt::MQTTComponent {
|
|||
} // namespace mqtt
|
||||
} // namespace esphome
|
||||
|
||||
#endif // USE_DATETIME_DATE
|
||||
#endif // USE_DATETIME_DATETIME
|
||||
#endif // USE_MQTT
|
||||
|
|
|
@ -243,7 +243,7 @@ ErrorCode VEML7700Component::configure_() {
|
|||
}
|
||||
|
||||
PSMRegister psm{0};
|
||||
psm.PSM = PSM::PSM_MODE_1;
|
||||
psm.PSM = PSMMode::PSM_MODE_1;
|
||||
psm.PSM_EN = false;
|
||||
ESP_LOGV(TAG, "Setting PSM to 0x%04X", psm.raw);
|
||||
err = this->write_register((uint8_t) CommandRegisters::PWR_SAVING, psm.raw_bytes, VEML_REG_SIZE);
|
||||
|
|
|
@ -24,7 +24,7 @@ enum class CommandRegisters : uint8_t {
|
|||
ALS_INT = 0x06 // R: ALS INT trigger event
|
||||
};
|
||||
|
||||
enum Gain : uint8_t {
|
||||
enum Gain : uint16_t {
|
||||
X_1 = 0,
|
||||
X_2 = 1,
|
||||
X_1_8 = 2,
|
||||
|
@ -32,7 +32,7 @@ enum Gain : uint8_t {
|
|||
};
|
||||
const uint8_t GAINS_COUNT = 4;
|
||||
|
||||
enum IntegrationTime : uint8_t {
|
||||
enum IntegrationTime : uint16_t {
|
||||
INTEGRATION_TIME_25MS = 0b1100,
|
||||
INTEGRATION_TIME_50MS = 0b1000,
|
||||
INTEGRATION_TIME_100MS = 0b0000,
|
||||
|
@ -42,14 +42,14 @@ enum IntegrationTime : uint8_t {
|
|||
};
|
||||
const uint8_t INTEGRATION_TIMES_COUNT = 6;
|
||||
|
||||
enum Persistence : uint8_t {
|
||||
enum Persistence : uint16_t {
|
||||
PERSISTENCE_1 = 0,
|
||||
PERSISTENCE_2 = 1,
|
||||
PERSISTENCE_4 = 2,
|
||||
PERSISTENCE_8 = 3,
|
||||
};
|
||||
|
||||
enum PSM : uint8_t {
|
||||
enum PSMMode : uint16_t {
|
||||
PSM_MODE_1 = 0,
|
||||
PSM_MODE_2 = 1,
|
||||
PSM_MODE_3 = 2,
|
||||
|
@ -92,7 +92,7 @@ union PSMRegister {
|
|||
uint8_t raw_bytes[2];
|
||||
struct {
|
||||
bool PSM_EN : 1;
|
||||
uint8_t PSM : 2;
|
||||
PSMMode PSM : 2;
|
||||
uint16_t reserved : 13;
|
||||
} __attribute__((packed));
|
||||
};
|
||||
|
|
|
@ -799,7 +799,7 @@ void VoiceAssistant::on_audio(const api::VoiceAssistantAudio &msg) {
|
|||
this->speaker_buffer_index_ += msg.data.length();
|
||||
this->speaker_buffer_size_ += msg.data.length();
|
||||
this->speaker_bytes_received_ += msg.data.length();
|
||||
ESP_LOGV(TAG, "Received audio: %" PRId32 " bytes from API", msg.data.length());
|
||||
ESP_LOGV(TAG, "Received audio: %u bytes from API", msg.data.length());
|
||||
} else {
|
||||
ESP_LOGE(TAG, "Cannot receive audio, buffer is full");
|
||||
}
|
||||
|
|
11
tests/components/a01nyub/common.yaml
Normal file
11
tests/components/a01nyub/common.yaml
Normal file
|
@ -0,0 +1,11 @@
|
|||
uart:
|
||||
- id: uart_a01nyub
|
||||
tx_pin: ${tx_pin}
|
||||
rx_pin: ${rx_pin}
|
||||
baud_rate: 9600
|
||||
|
||||
sensor:
|
||||
- platform: a01nyub
|
||||
id: a01nyub_sensor
|
||||
name: a01nyub Distance
|
||||
uart_id: uart_a01nyub
|
|
@ -1,13 +1,5 @@
|
|||
uart:
|
||||
- id: uart_a01nyub
|
||||
tx_pin:
|
||||
number: 4
|
||||
rx_pin:
|
||||
number: 5
|
||||
baud_rate: 9600
|
||||
substitutions:
|
||||
tx_pin: GPIO4
|
||||
rx_pin: GPIO5
|
||||
|
||||
sensor:
|
||||
- platform: a01nyub
|
||||
id: a01nyub_sensor
|
||||
name: a01nyub Distance
|
||||
uart_id: uart_a01nyub
|
||||
<<: !include common.yaml
|
||||
|
|
|
@ -1,13 +1,5 @@
|
|||
uart:
|
||||
- id: uart_a01nyub
|
||||
tx_pin:
|
||||
number: 4
|
||||
rx_pin:
|
||||
number: 5
|
||||
baud_rate: 9600
|
||||
substitutions:
|
||||
tx_pin: GPIO4
|
||||
rx_pin: GPIO5
|
||||
|
||||
sensor:
|
||||
- platform: a01nyub
|
||||
id: a01nyub_sensor
|
||||
name: a01nyub Distance
|
||||
uart_id: uart_a01nyub
|
||||
<<: !include common.yaml
|
||||
|
|
|
@ -1,13 +1,5 @@
|
|||
uart:
|
||||
- id: uart_a01nyub
|
||||
tx_pin:
|
||||
number: 17
|
||||
rx_pin:
|
||||
number: 16
|
||||
baud_rate: 9600
|
||||
substitutions:
|
||||
tx_pin: GPIO17
|
||||
rx_pin: GPIO16
|
||||
|
||||
sensor:
|
||||
- platform: a01nyub
|
||||
id: a01nyub_sensor
|
||||
name: a01nyub Distance
|
||||
uart_id: uart_a01nyub
|
||||
<<: !include common.yaml
|
||||
|
|
|
@ -1,13 +1,5 @@
|
|||
uart:
|
||||
- id: uart_a01nyub
|
||||
tx_pin:
|
||||
number: 17
|
||||
rx_pin:
|
||||
number: 16
|
||||
baud_rate: 9600
|
||||
substitutions:
|
||||
tx_pin: GPIO17
|
||||
rx_pin: GPIO16
|
||||
|
||||
sensor:
|
||||
- platform: a01nyub
|
||||
id: a01nyub_sensor
|
||||
name: a01nyub Distance
|
||||
uart_id: uart_a01nyub
|
||||
<<: !include common.yaml
|
||||
|
|
|
@ -1,13 +1,5 @@
|
|||
uart:
|
||||
- id: uart_a01nyub
|
||||
tx_pin:
|
||||
number: 4
|
||||
rx_pin:
|
||||
number: 5
|
||||
baud_rate: 9600
|
||||
substitutions:
|
||||
tx_pin: GPIO4
|
||||
rx_pin: GPIO5
|
||||
|
||||
sensor:
|
||||
- platform: a01nyub
|
||||
id: a01nyub_sensor
|
||||
name: a01nyub Distance
|
||||
uart_id: uart_a01nyub
|
||||
<<: !include common.yaml
|
||||
|
|
|
@ -1,13 +1,5 @@
|
|||
uart:
|
||||
- id: uart_a01nyub
|
||||
tx_pin:
|
||||
number: 4
|
||||
rx_pin:
|
||||
number: 5
|
||||
baud_rate: 9600
|
||||
substitutions:
|
||||
tx_pin: GPIO4
|
||||
rx_pin: GPIO5
|
||||
|
||||
sensor:
|
||||
- platform: a01nyub
|
||||
id: a01nyub_sensor
|
||||
name: a01nyub Distance
|
||||
uart_id: uart_a01nyub
|
||||
<<: !include common.yaml
|
||||
|
|
|
@ -50,12 +50,12 @@ api:
|
|||
then:
|
||||
- logger.log:
|
||||
# yamllint disable rule:line-length
|
||||
format: "Bool: %s (%u), Int: %d (%u), Float: %f (%u), String: %s (%u)"
|
||||
format: "Bool: %s (%u), Int: %ld (%u), Float: %f (%u), String: %s (%u)"
|
||||
# yamllint enable rule:line-length
|
||||
args:
|
||||
- YESNO(bool_arr[0])
|
||||
- bool_arr.size()
|
||||
- int_arr[0]
|
||||
- (long) int_arr[0]
|
||||
- int_arr.size()
|
||||
- float_arr[0]
|
||||
- float_arr.size()
|
||||
|
|
|
@ -1,3 +0,0 @@
|
|||
sensor:
|
||||
- platform: esp32_hall
|
||||
name: ESP32 Hall Sensor
|
|
@ -1 +0,0 @@
|
|||
<<: !include common.yaml
|
|
@ -1 +1,3 @@
|
|||
<<: !include common.yaml
|
||||
sensor:
|
||||
- platform: esp32_hall
|
||||
name: ESP32 Hall Sensor
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
ethernet:
|
||||
type: LAN8720
|
||||
type: DP83848
|
||||
mdc_pin: 23
|
||||
mdio_pin: 25
|
||||
clk_mode: GPIO0_IN
|
|
@ -1,5 +1,5 @@
|
|||
ethernet:
|
||||
type: LAN8720
|
||||
type: IP101
|
||||
mdc_pin: 23
|
||||
mdio_pin: 25
|
||||
clk_mode: GPIO0_IN
|
12
tests/components/ethernet/common-jl1101.yaml
Normal file
12
tests/components/ethernet/common-jl1101.yaml
Normal file
|
@ -0,0 +1,12 @@
|
|||
ethernet:
|
||||
type: JL1101
|
||||
mdc_pin: 23
|
||||
mdio_pin: 25
|
||||
clk_mode: GPIO0_IN
|
||||
phy_addr: 0
|
||||
power_pin: 26
|
||||
manual_ip:
|
||||
static_ip: 192.168.178.56
|
||||
gateway: 192.168.178.1
|
||||
subnet: 255.255.255.0
|
||||
domain: .local
|
12
tests/components/ethernet/common-ksz8081.yaml
Normal file
12
tests/components/ethernet/common-ksz8081.yaml
Normal file
|
@ -0,0 +1,12 @@
|
|||
ethernet:
|
||||
type: KSZ8081
|
||||
mdc_pin: 23
|
||||
mdio_pin: 25
|
||||
clk_mode: GPIO0_IN
|
||||
phy_addr: 0
|
||||
power_pin: 26
|
||||
manual_ip:
|
||||
static_ip: 192.168.178.56
|
||||
gateway: 192.168.178.1
|
||||
subnet: 255.255.255.0
|
||||
domain: .local
|
12
tests/components/ethernet/common-ksz8081rna.yaml
Normal file
12
tests/components/ethernet/common-ksz8081rna.yaml
Normal file
|
@ -0,0 +1,12 @@
|
|||
ethernet:
|
||||
type: KSZ8081RNA
|
||||
mdc_pin: 23
|
||||
mdio_pin: 25
|
||||
clk_mode: GPIO0_IN
|
||||
phy_addr: 0
|
||||
power_pin: 26
|
||||
manual_ip:
|
||||
static_ip: 192.168.178.56
|
||||
gateway: 192.168.178.1
|
||||
subnet: 255.255.255.0
|
||||
domain: .local
|
12
tests/components/ethernet/common-rtl8201.yaml
Normal file
12
tests/components/ethernet/common-rtl8201.yaml
Normal file
|
@ -0,0 +1,12 @@
|
|||
ethernet:
|
||||
type: RTL8201
|
||||
mdc_pin: 23
|
||||
mdio_pin: 25
|
||||
clk_mode: GPIO0_IN
|
||||
phy_addr: 0
|
||||
power_pin: 26
|
||||
manual_ip:
|
||||
static_ip: 192.168.178.56
|
||||
gateway: 192.168.178.1
|
||||
subnet: 255.255.255.0
|
||||
domain: .local
|
|
@ -1,11 +1,11 @@
|
|||
ethernet:
|
||||
type: W5500
|
||||
clk_pin: GPIO19
|
||||
mosi_pin: GPIO21
|
||||
miso_pin: GPIO23
|
||||
cs_pin: GPIO18
|
||||
interrupt_pin: GPIO36
|
||||
reset_pin: GPIO22
|
||||
clk_pin: 19
|
||||
mosi_pin: 21
|
||||
miso_pin: 23
|
||||
cs_pin: 18
|
||||
interrupt_pin: 36
|
||||
reset_pin: 22
|
||||
clock_speed: 10Mhz
|
||||
manual_ip:
|
||||
static_ip: 192.168.178.56
|
1
tests/components/ethernet/test-dp83848.esp32-idf.yaml
Normal file
1
tests/components/ethernet/test-dp83848.esp32-idf.yaml
Normal file
|
@ -0,0 +1 @@
|
|||
<<: !include common-dp83848.yaml
|
1
tests/components/ethernet/test-dp83848.esp32.yaml
Normal file
1
tests/components/ethernet/test-dp83848.esp32.yaml
Normal file
|
@ -0,0 +1 @@
|
|||
<<: !include common-dp83848.yaml
|
1
tests/components/ethernet/test-ip101.esp32-idf.yaml
Normal file
1
tests/components/ethernet/test-ip101.esp32-idf.yaml
Normal file
|
@ -0,0 +1 @@
|
|||
<<: !include common-ip101.yaml
|
1
tests/components/ethernet/test-ip101.esp32.yaml
Normal file
1
tests/components/ethernet/test-ip101.esp32.yaml
Normal file
|
@ -0,0 +1 @@
|
|||
<<: !include common-ip101.yaml
|
1
tests/components/ethernet/test-jl1101.esp32-idf.yaml
Normal file
1
tests/components/ethernet/test-jl1101.esp32-idf.yaml
Normal file
|
@ -0,0 +1 @@
|
|||
<<: !include common-jl1101.yaml
|
1
tests/components/ethernet/test-jl1101.esp32.yaml
Normal file
1
tests/components/ethernet/test-jl1101.esp32.yaml
Normal file
|
@ -0,0 +1 @@
|
|||
<<: !include common-jl1101.yaml
|
1
tests/components/ethernet/test-ksz8081.esp32-idf.yaml
Normal file
1
tests/components/ethernet/test-ksz8081.esp32-idf.yaml
Normal file
|
@ -0,0 +1 @@
|
|||
<<: !include common-ksz8081.yaml
|
1
tests/components/ethernet/test-ksz8081.esp32.yaml
Normal file
1
tests/components/ethernet/test-ksz8081.esp32.yaml
Normal file
|
@ -0,0 +1 @@
|
|||
<<: !include common-ksz8081.yaml
|
1
tests/components/ethernet/test-ksz8081rna.esp32-idf.yaml
Normal file
1
tests/components/ethernet/test-ksz8081rna.esp32-idf.yaml
Normal file
|
@ -0,0 +1 @@
|
|||
<<: !include common-ksz8081rna.yaml
|
1
tests/components/ethernet/test-ksz8081rna.esp32.yaml
Normal file
1
tests/components/ethernet/test-ksz8081rna.esp32.yaml
Normal file
|
@ -0,0 +1 @@
|
|||
<<: !include common-ksz8081rna.yaml
|
1
tests/components/ethernet/test-lan8720.esp32-idf.yaml
Normal file
1
tests/components/ethernet/test-lan8720.esp32-idf.yaml
Normal file
|
@ -0,0 +1 @@
|
|||
<<: !include common-lan8720.yaml
|
1
tests/components/ethernet/test-lan8720.esp32.yaml
Normal file
1
tests/components/ethernet/test-lan8720.esp32.yaml
Normal file
|
@ -0,0 +1 @@
|
|||
<<: !include common-lan8720.yaml
|
1
tests/components/ethernet/test-rtl8201.esp32-idf.yaml
Normal file
1
tests/components/ethernet/test-rtl8201.esp32-idf.yaml
Normal file
|
@ -0,0 +1 @@
|
|||
<<: !include common-rtl8201.yaml
|
1
tests/components/ethernet/test-rtl8201.esp32.yaml
Normal file
1
tests/components/ethernet/test-rtl8201.esp32.yaml
Normal file
|
@ -0,0 +1 @@
|
|||
<<: !include common-rtl8201.yaml
|
1
tests/components/ethernet/test-w5500.esp32-idf.yaml
Normal file
1
tests/components/ethernet/test-w5500.esp32-idf.yaml
Normal file
|
@ -0,0 +1 @@
|
|||
<<: !include common-w5500.yaml
|
1
tests/components/ethernet/test-w5500.esp32.yaml
Normal file
1
tests/components/ethernet/test-w5500.esp32.yaml
Normal file
|
@ -0,0 +1 @@
|
|||
<<: !include common-w5500.yaml
|
|
@ -1 +0,0 @@
|
|||
<<: !include common.yaml
|
|
@ -1 +0,0 @@
|
|||
<<: !include common.yaml
|
|
@ -1,14 +0,0 @@
|
|||
ethernet:
|
||||
type: W5500
|
||||
clk_pin: GPIO19
|
||||
mosi_pin: GPIO21
|
||||
miso_pin: GPIO23
|
||||
cs_pin: GPIO18
|
||||
interrupt_pin: GPIO36
|
||||
reset_pin: GPIO22
|
||||
clock_speed: 10Mhz
|
||||
manual_ip:
|
||||
static_ip: 192.168.178.56
|
||||
gateway: 192.168.178.1
|
||||
subnet: 255.255.255.0
|
||||
domain: .local
|
|
@ -15,10 +15,10 @@ esphome:
|
|||
on_response:
|
||||
then:
|
||||
- logger.log:
|
||||
format: "Response status: %d, Duration: %u ms"
|
||||
format: "Response status: %d, Duration: %lu ms"
|
||||
args:
|
||||
- response->status_code
|
||||
- response->duration_ms
|
||||
- (long) response->duration_ms
|
||||
- http_request.post:
|
||||
url: https://esphome.io
|
||||
headers:
|
||||
|
|
59
tests/components/wireguard/common.yaml
Normal file
59
tests/components/wireguard/common.yaml
Normal file
|
@ -0,0 +1,59 @@
|
|||
wifi:
|
||||
ssid: "MySSID1"
|
||||
password: "password1"
|
||||
|
||||
time:
|
||||
- platform: sntp
|
||||
|
||||
wireguard:
|
||||
address: 172.16.34.100
|
||||
netmask: 255.255.255.0
|
||||
# NEVER use the following keys for your VPN -- they are now public!
|
||||
private_key: wPBMxtNYH3mChicrbpsRpZIasIdPq3yZuthn23FbGG8=
|
||||
peer_public_key: Hs2JfikvYU03/Kv3YoAs1hrUIPPTEkpsZKSPUljE9yc=
|
||||
peer_preshared_key: 20fjM5GRnSolGPC5SRj9ljgIUyQfruv0B0bvLl3Yt60=
|
||||
peer_endpoint: wg.server.example
|
||||
peer_persistent_keepalive: 25s
|
||||
peer_allowed_ips:
|
||||
- 172.16.34.0/24
|
||||
- 192.168.4.0/24
|
||||
|
||||
binary_sensor:
|
||||
- platform: wireguard
|
||||
status:
|
||||
name: 'WireGuard Status'
|
||||
enabled:
|
||||
name: 'WireGuard Enabled'
|
||||
|
||||
sensor:
|
||||
- platform: wireguard
|
||||
latest_handshake:
|
||||
name: 'WireGuard Latest Handshake'
|
||||
|
||||
text_sensor:
|
||||
- platform: wireguard
|
||||
address:
|
||||
name: 'WireGuard Address'
|
||||
|
||||
button:
|
||||
- platform: template
|
||||
name: 'Toggle WireGuard'
|
||||
entity_category: config
|
||||
on_press:
|
||||
- if:
|
||||
condition: wireguard.enabled
|
||||
then:
|
||||
- wireguard.disable:
|
||||
else:
|
||||
- wireguard.enable:
|
||||
|
||||
- platform: template
|
||||
name: 'Log WireGuard status'
|
||||
entity_category: config
|
||||
on_press:
|
||||
- if:
|
||||
condition: wireguard.peer_online
|
||||
then:
|
||||
- logger.log: 'wireguard remote peer is online'
|
||||
else:
|
||||
- logger.log: 'wireguard remote peer is offline'
|
|
@ -1,59 +1 @@
|
|||
wifi:
|
||||
ssid: "MySSID1"
|
||||
password: "password1"
|
||||
|
||||
time:
|
||||
- platform: sntp
|
||||
|
||||
wireguard:
|
||||
address: 172.16.34.100
|
||||
netmask: 255.255.255.0
|
||||
# NEVER use the following keys for your vpn, they are now public!
|
||||
private_key: wPBMxtNYH3mChicrbpsRpZIasIdPq3yZuthn23FbGG8=
|
||||
peer_public_key: Hs2JfikvYU03/Kv3YoAs1hrUIPPTEkpsZKSPUljE9yc=
|
||||
peer_preshared_key: 20fjM5GRnSolGPC5SRj9ljgIUyQfruv0B0bvLl3Yt60=
|
||||
peer_endpoint: wg.server.example
|
||||
peer_persistent_keepalive: 25s
|
||||
peer_allowed_ips:
|
||||
- 172.16.34.0/24
|
||||
- 192.168.4.0/24
|
||||
|
||||
binary_sensor:
|
||||
- platform: wireguard
|
||||
status:
|
||||
name: 'WireGuard Status'
|
||||
enabled:
|
||||
name: 'WireGuard Enabled'
|
||||
|
||||
sensor:
|
||||
- platform: wireguard
|
||||
latest_handshake:
|
||||
name: 'WireGuard Latest Handshake'
|
||||
|
||||
text_sensor:
|
||||
- platform: wireguard
|
||||
address:
|
||||
name: 'WireGuard Address'
|
||||
|
||||
button:
|
||||
- platform: template
|
||||
name: 'Toggle WireGuard'
|
||||
entity_category: config
|
||||
on_press:
|
||||
- if:
|
||||
condition: wireguard.enabled
|
||||
then:
|
||||
- wireguard.disable:
|
||||
else:
|
||||
- wireguard.enable:
|
||||
|
||||
- platform: template
|
||||
name: 'Log WireGuard status'
|
||||
entity_category: config
|
||||
on_press:
|
||||
- if:
|
||||
condition: wireguard.peer_online
|
||||
then:
|
||||
- logger.log: 'wireguard remote peer is online'
|
||||
else:
|
||||
- logger.log: 'wireguard remote peer is offline'
|
||||
<<: !include common.yaml
|
||||
|
|
|
@ -1,60 +1 @@
|
|||
wifi:
|
||||
ssid: MySSID
|
||||
password: password1
|
||||
|
||||
time:
|
||||
- platform: sntp
|
||||
|
||||
wireguard:
|
||||
id: vpn
|
||||
address: 172.16.34.100
|
||||
netmask: 255.255.255.0
|
||||
# NEVER use the following keys for your vpn, they are now public!
|
||||
private_key: wPBMxtNYH3mChicrbpsRpZIasIdPq3yZuthn23FbGG8=
|
||||
peer_public_key: Hs2JfikvYU03/Kv3YoAs1hrUIPPTEkpsZKSPUljE9yc=
|
||||
peer_preshared_key: 20fjM5GRnSolGPC5SRj9ljgIUyQfruv0B0bvLl3Yt60=
|
||||
peer_endpoint: wg.server.example
|
||||
peer_persistent_keepalive: 25s
|
||||
peer_allowed_ips:
|
||||
- 172.16.34.0/24
|
||||
- 192.168.4.0/24
|
||||
|
||||
binary_sensor:
|
||||
- platform: wireguard
|
||||
status:
|
||||
name: 'WireGuard Status'
|
||||
enabled:
|
||||
name: 'WireGuard Enabled'
|
||||
|
||||
sensor:
|
||||
- platform: wireguard
|
||||
latest_handshake:
|
||||
name: 'WireGuard Latest Handshake'
|
||||
|
||||
text_sensor:
|
||||
- platform: wireguard
|
||||
address:
|
||||
name: 'WireGuard Address'
|
||||
|
||||
button:
|
||||
- platform: template
|
||||
name: 'Toggle WireGuard'
|
||||
entity_category: config
|
||||
on_press:
|
||||
- if:
|
||||
condition: wireguard.enabled
|
||||
then:
|
||||
- wireguard.disable:
|
||||
else:
|
||||
- wireguard.enable:
|
||||
|
||||
- platform: template
|
||||
name: 'Log WireGuard status'
|
||||
entity_category: config
|
||||
on_press:
|
||||
- if:
|
||||
condition: wireguard.peer_online
|
||||
then:
|
||||
- logger.log: 'wireguard remote peer is online'
|
||||
else:
|
||||
- logger.log: 'wireguard remote peer is offline'
|
||||
<<: !include common.yaml
|
||||
|
|
|
@ -1,60 +1 @@
|
|||
wifi:
|
||||
ssid: MySSID
|
||||
password: password1
|
||||
|
||||
time:
|
||||
- platform: sntp
|
||||
|
||||
wireguard:
|
||||
id: vpn
|
||||
address: 172.16.34.100
|
||||
netmask: 255.255.255.0
|
||||
# NEVER use the following keys for your vpn, they are now public!
|
||||
private_key: wPBMxtNYH3mChicrbpsRpZIasIdPq3yZuthn23FbGG8=
|
||||
peer_public_key: Hs2JfikvYU03/Kv3YoAs1hrUIPPTEkpsZKSPUljE9yc=
|
||||
peer_preshared_key: 20fjM5GRnSolGPC5SRj9ljgIUyQfruv0B0bvLl3Yt60=
|
||||
peer_endpoint: wg.server.example
|
||||
peer_persistent_keepalive: 25s
|
||||
peer_allowed_ips:
|
||||
- 172.16.34.0/24
|
||||
- 192.168.4.0/24
|
||||
|
||||
binary_sensor:
|
||||
- platform: wireguard
|
||||
status:
|
||||
name: 'WireGuard Status'
|
||||
enabled:
|
||||
name: 'WireGuard Enabled'
|
||||
|
||||
sensor:
|
||||
- platform: wireguard
|
||||
latest_handshake:
|
||||
name: 'WireGuard Latest Handshake'
|
||||
|
||||
text_sensor:
|
||||
- platform: wireguard
|
||||
address:
|
||||
name: 'WireGuard Address'
|
||||
|
||||
button:
|
||||
- platform: template
|
||||
name: 'Toggle WireGuard'
|
||||
entity_category: config
|
||||
on_press:
|
||||
- if:
|
||||
condition: wireguard.enabled
|
||||
then:
|
||||
- wireguard.disable:
|
||||
else:
|
||||
- wireguard.enable:
|
||||
|
||||
- platform: template
|
||||
name: 'Log WireGuard status'
|
||||
entity_category: config
|
||||
on_press:
|
||||
- if:
|
||||
condition: wireguard.peer_online
|
||||
then:
|
||||
- logger.log: 'wireguard remote peer is online'
|
||||
else:
|
||||
- logger.log: 'wireguard remote peer is offline'
|
||||
<<: !include common.yaml
|
||||
|
|
|
@ -1,62 +1,4 @@
|
|||
wifi:
|
||||
ssid: "MySSID1"
|
||||
password: "password1"
|
||||
<<: !include common.yaml
|
||||
|
||||
network:
|
||||
enable_ipv6: true
|
||||
|
||||
time:
|
||||
- platform: sntp
|
||||
|
||||
wireguard:
|
||||
address: 172.16.34.100
|
||||
netmask: 255.255.255.0
|
||||
# NEVER use the following keys for your vpn, they are now public!
|
||||
private_key: wPBMxtNYH3mChicrbpsRpZIasIdPq3yZuthn23FbGG8=
|
||||
peer_public_key: Hs2JfikvYU03/Kv3YoAs1hrUIPPTEkpsZKSPUljE9yc=
|
||||
peer_preshared_key: 20fjM5GRnSolGPC5SRj9ljgIUyQfruv0B0bvLl3Yt60=
|
||||
peer_endpoint: wg.server.example
|
||||
peer_persistent_keepalive: 25s
|
||||
peer_allowed_ips:
|
||||
- 172.16.34.0/24
|
||||
- 192.168.4.0/24
|
||||
|
||||
binary_sensor:
|
||||
- platform: wireguard
|
||||
status:
|
||||
name: 'WireGuard Status'
|
||||
enabled:
|
||||
name: 'WireGuard Enabled'
|
||||
|
||||
sensor:
|
||||
- platform: wireguard
|
||||
latest_handshake:
|
||||
name: 'WireGuard Latest Handshake'
|
||||
|
||||
text_sensor:
|
||||
- platform: wireguard
|
||||
address:
|
||||
name: 'WireGuard Address'
|
||||
|
||||
button:
|
||||
- platform: template
|
||||
name: 'Toggle WireGuard'
|
||||
entity_category: config
|
||||
on_press:
|
||||
- if:
|
||||
condition: wireguard.enabled
|
||||
then:
|
||||
- wireguard.disable:
|
||||
else:
|
||||
- wireguard.enable:
|
||||
|
||||
- platform: template
|
||||
name: 'Log WireGuard status'
|
||||
entity_category: config
|
||||
on_press:
|
||||
- if:
|
||||
condition: wireguard.peer_online
|
||||
then:
|
||||
- logger.log: 'wireguard remote peer is online'
|
||||
else:
|
||||
- logger.log: 'wireguard remote peer is offline'
|
||||
|
|
|
@ -1,62 +1,4 @@
|
|||
wifi:
|
||||
ssid: "MySSID1"
|
||||
password: "password1"
|
||||
<<: !include common.yaml
|
||||
|
||||
network:
|
||||
enable_ipv6: true
|
||||
|
||||
time:
|
||||
- platform: sntp
|
||||
|
||||
wireguard:
|
||||
address: 172.16.34.100
|
||||
netmask: 255.255.255.0
|
||||
# NEVER use the following keys for your vpn, they are now public!
|
||||
private_key: wPBMxtNYH3mChicrbpsRpZIasIdPq3yZuthn23FbGG8=
|
||||
peer_public_key: Hs2JfikvYU03/Kv3YoAs1hrUIPPTEkpsZKSPUljE9yc=
|
||||
peer_preshared_key: 20fjM5GRnSolGPC5SRj9ljgIUyQfruv0B0bvLl3Yt60=
|
||||
peer_endpoint: wg.server.example
|
||||
peer_persistent_keepalive: 25s
|
||||
peer_allowed_ips:
|
||||
- 172.16.34.0/24
|
||||
- 192.168.4.0/24
|
||||
|
||||
binary_sensor:
|
||||
- platform: wireguard
|
||||
status:
|
||||
name: 'WireGuard Status'
|
||||
enabled:
|
||||
name: 'WireGuard Enabled'
|
||||
|
||||
sensor:
|
||||
- platform: wireguard
|
||||
latest_handshake:
|
||||
name: 'WireGuard Latest Handshake'
|
||||
|
||||
text_sensor:
|
||||
- platform: wireguard
|
||||
address:
|
||||
name: 'WireGuard Address'
|
||||
|
||||
button:
|
||||
- platform: template
|
||||
name: 'Toggle WireGuard'
|
||||
entity_category: config
|
||||
on_press:
|
||||
- if:
|
||||
condition: wireguard.enabled
|
||||
then:
|
||||
- wireguard.disable:
|
||||
else:
|
||||
- wireguard.enable:
|
||||
|
||||
- platform: template
|
||||
name: 'Log WireGuard status'
|
||||
entity_category: config
|
||||
on_press:
|
||||
- if:
|
||||
condition: wireguard.peer_online
|
||||
then:
|
||||
- logger.log: 'wireguard remote peer is online'
|
||||
else:
|
||||
- logger.log: 'wireguard remote peer is offline'
|
||||
|
|
|
@ -1,62 +1,4 @@
|
|||
wifi:
|
||||
ssid: "MySSID1"
|
||||
password: "password1"
|
||||
<<: !include common.yaml
|
||||
|
||||
network:
|
||||
enable_ipv6: true
|
||||
|
||||
time:
|
||||
- platform: sntp
|
||||
|
||||
wireguard:
|
||||
address: 172.16.34.100
|
||||
netmask: 255.255.255.0
|
||||
# NEVER use the following keys for your vpn, they are now public!
|
||||
private_key: wPBMxtNYH3mChicrbpsRpZIasIdPq3yZuthn23FbGG8=
|
||||
peer_public_key: Hs2JfikvYU03/Kv3YoAs1hrUIPPTEkpsZKSPUljE9yc=
|
||||
peer_preshared_key: 20fjM5GRnSolGPC5SRj9ljgIUyQfruv0B0bvLl3Yt60=
|
||||
peer_endpoint: wg.server.example
|
||||
peer_persistent_keepalive: 25s
|
||||
peer_allowed_ips:
|
||||
- 172.16.34.0/24
|
||||
- 192.168.4.0/24
|
||||
|
||||
binary_sensor:
|
||||
- platform: wireguard
|
||||
status:
|
||||
name: 'WireGuard Status'
|
||||
enabled:
|
||||
name: 'WireGuard Enabled'
|
||||
|
||||
sensor:
|
||||
- platform: wireguard
|
||||
latest_handshake:
|
||||
name: 'WireGuard Latest Handshake'
|
||||
|
||||
text_sensor:
|
||||
- platform: wireguard
|
||||
address:
|
||||
name: 'WireGuard Address'
|
||||
|
||||
button:
|
||||
- platform: template
|
||||
name: 'Toggle WireGuard'
|
||||
entity_category: config
|
||||
on_press:
|
||||
- if:
|
||||
condition: wireguard.enabled
|
||||
then:
|
||||
- wireguard.disable:
|
||||
else:
|
||||
- wireguard.enable:
|
||||
|
||||
- platform: template
|
||||
name: 'Log WireGuard status'
|
||||
entity_category: config
|
||||
on_press:
|
||||
- if:
|
||||
condition: wireguard.peer_online
|
||||
then:
|
||||
- logger.log: 'wireguard remote peer is online'
|
||||
else:
|
||||
- logger.log: 'wireguard remote peer is offline'
|
||||
|
|
Loading…
Reference in a new issue