Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle network disconnection and add support for eth interface #13

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
2a2d20a
support empty schemas and one platform components (#4999)
glmnet Jun 25, 2023
ef84937
Update webserver to 56d73b5 (#5007)
jesserockz Jun 25, 2023
d9398a9
update dsmr to 0.7 (#5011)
Pvlerick Jun 26, 2023
bd9a4ff
add water delivered to dsmr component (#4237)
jerome992 Jun 27, 2023
46c7954
Move on_shutdown content to stop_connection_ method
droscy Jun 27, 2023
8f4abf6
Update sync workflow (#5017)
jesserockz Jun 27, 2023
9d21ccc
Bump aioesphomeapi from 14.1.0 to 15.0.0 (#5012)
dependabot[bot] Jun 27, 2023
8ce98dd
Bump pyupgrade from 3.4.0 to 3.7.0 (#4971)
dependabot[bot] Jun 27, 2023
108fabe
Bump pytest from 7.3.2 to 7.4.0 (#5000)
dependabot[bot] Jun 27, 2023
9a149a7
Synchronise Device Classes from Home Assistant (#5018)
esphomebot Jun 27, 2023
c82be2c
Fixes compressed downloads (#5014)
fdcastel Jun 27, 2023
68119dd
Attempt to fix script parameters (#4627)
jesserockz Jun 27, 2023
951157d
Add CONFIG_BT_BLE_42_FEATURES_SUPPORTED for ble (#5008)
jesserockz Jun 27, 2023
ac5246e
Remove yaml test cache (#5019)
jesserockz Jun 28, 2023
2d88f62
Use wireguard loop() to hook local connection loss
droscy Jun 27, 2023
8076214
[SCD30] Disable negative temperature offset (#4850)
ardichoke Jun 28, 2023
0e93b8e
Bump esptool from 4.6 to 4.6.2 (#4949)
dependabot[bot] Jun 28, 2023
c5eb394
Bump pytest-mock from 3.10.0 to 3.11.1 (#4977)
dependabot[bot] Jun 28, 2023
7d7e456
Merge branch 'dev' into wireguard/main
droscy Jun 30, 2023
f7ea9c4
Merge branch 'fix/wg/wifi_disconnect' into wireguard/main
droscy Jul 1, 2023
c9d255a
Bump esp_wireguard to version 0.3.2
droscy Jul 1, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -241,12 +241,6 @@ jobs:
with:
python-version: ${{ env.DEFAULT_PYTHON }}
cache-key: ${{ needs.common.outputs.cache-key }}
- name: Cache platformio
uses: actions/cache@v3.3.1
with:
path: ~/.platformio
# yamllint disable-line rule:line-length
key: platformio-test${{ matrix.file }}-${{ hashFiles('platformio.ini') }}
- name: Run esphome compile tests/test${{ matrix.file }}.yaml
run: |
. venv/bin/activate
Expand Down
15 changes: 2 additions & 13 deletions .github/workflows/sync-device-classes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,12 @@ on:
schedule:
- cron: '45 6 * * *'

permissions:
contents: write
pull-requests: write

jobs:
sync:
name: Sync Device Classes
runs-on: ubuntu-latest
if: github.repository == 'esphome/esphome'
steps:
- name: Checkout
uses: actions/checkout@v3
Expand All @@ -38,15 +36,6 @@ jobs:
run: |
python ./script/sync-device_class.py

- name: Get PR template
id: pr-template-body
run: |
body=$(cat .github/PULL_REQUEST_TEMPLATE.md)
delimiter="$(openssl rand -hex 8)"
echo "body<<$delimiter" >> $GITHUB_OUTPUT
echo "$body" >> $GITHUB_OUTPUT
echo "$delimiter" >> $GITHUB_OUTPUT

- name: Commit changes
uses: peter-evans/create-pull-request@v5
with:
Expand All @@ -56,5 +45,5 @@ jobs:
branch: sync/device-classes
delete-branch: true
title: "Synchronise Device Classes from Home Assistant"
body: ${{ steps.pr-template-body.outputs.body }}
body-path: .github/PULL_REQUEST_TEMPLATE.md
token: ${{ secrets.DEVICE_CLASS_SYNC_TOKEN }}
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ repos:
- --branch=release
- --branch=beta
- repo: https://github.com/asottile/pyupgrade
rev: v3.4.0
rev: v3.7.0
hooks:
- id: pyupgrade
args: [--py39-plus]
2 changes: 2 additions & 0 deletions esphome/components/button/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
CONF_TRIGGER_ID,
CONF_MQTT_ID,
DEVICE_CLASS_EMPTY,
DEVICE_CLASS_IDENTIFY,
DEVICE_CLASS_RESTART,
DEVICE_CLASS_UPDATE,
)
Expand All @@ -24,6 +25,7 @@

DEVICE_CLASSES = [
DEVICE_CLASS_EMPTY,
DEVICE_CLASS_IDENTIFY,
DEVICE_CLASS_RESTART,
DEVICE_CLASS_UPDATE,
]
Expand Down
5 changes: 4 additions & 1 deletion esphome/components/dsmr/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
CONF_DECRYPTION_KEY = "decryption_key"
CONF_DSMR_ID = "dsmr_id"
CONF_GAS_MBUS_ID = "gas_mbus_id"
CONF_WATER_MBUS_ID = "water_mbus_id"
CONF_MAX_TELEGRAM_LENGTH = "max_telegram_length"
CONF_REQUEST_INTERVAL = "request_interval"
CONF_REQUEST_PIN = "request_pin"
Expand Down Expand Up @@ -53,6 +54,7 @@ def _validate_key(value):
cv.Optional(CONF_DECRYPTION_KEY): _validate_key,
cv.Optional(CONF_CRC_CHECK, default=True): cv.boolean,
cv.Optional(CONF_GAS_MBUS_ID, default=1): cv.int_,
cv.Optional(CONF_WATER_MBUS_ID, default=2): cv.int_,
cv.Optional(CONF_MAX_TELEGRAM_LENGTH, default=1500): cv.int_,
cv.Optional(CONF_REQUEST_PIN): pins.gpio_output_pin_schema,
cv.Optional(
Expand Down Expand Up @@ -82,9 +84,10 @@ async def to_code(config):
cg.add(var.set_receive_timeout(config[CONF_RECEIVE_TIMEOUT].total_milliseconds))

cg.add_build_flag("-DDSMR_GAS_MBUS_ID=" + str(config[CONF_GAS_MBUS_ID]))
cg.add_build_flag("-DDSMR_WATER_MBUS_ID=" + str(config[CONF_WATER_MBUS_ID]))

# DSMR Parser
cg.add_library("glmnet/Dsmr", "0.5")
cg.add_library("glmnet/Dsmr", "0.7")

# Crypto
cg.add_library("rweather/Crypto", "0.4.0")
7 changes: 7 additions & 0 deletions esphome/components/dsmr/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
DEVICE_CLASS_GAS,
DEVICE_CLASS_POWER,
DEVICE_CLASS_VOLTAGE,
DEVICE_CLASS_WATER,
STATE_CLASS_MEASUREMENT,
STATE_CLASS_TOTAL_INCREASING,
UNIT_AMPERE,
Expand Down Expand Up @@ -236,6 +237,12 @@
device_class=DEVICE_CLASS_GAS,
state_class=STATE_CLASS_TOTAL_INCREASING,
),
cv.Optional("water_delivered"): sensor.sensor_schema(
unit_of_measurement=UNIT_CUBIC_METER,
accuracy_decimals=3,
device_class=DEVICE_CLASS_WATER,
state_class=STATE_CLASS_TOTAL_INCREASING,
),
}
).extend(cv.COMPONENT_SCHEMA)

Expand Down
1 change: 1 addition & 0 deletions esphome/components/esp32_ble/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,4 @@ async def to_code(config):

if CORE.using_esp_idf:
add_idf_sdkconfig_option("CONFIG_BT_ENABLED", True)
add_idf_sdkconfig_option("CONFIG_BT_BLE_42_FEATURES_SUPPORTED", True)
19 changes: 12 additions & 7 deletions esphome/components/scd30/scd30.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,18 @@ void SCD30Component::setup() {
ESP_LOGD(TAG, "SCD30 Firmware v%0d.%02d", (uint16_t(raw_firmware_version[0]) >> 8),
uint16_t(raw_firmware_version[0] & 0xFF));

if (this->temperature_offset_ != 0) {
if (!this->write_command(SCD30_CMD_TEMPERATURE_OFFSET, (uint16_t) (temperature_offset_ * 100.0))) {
ESP_LOGE(TAG, "Sensor SCD30 error setting temperature offset.");
this->error_code_ = MEASUREMENT_INIT_FAILED;
this->mark_failed();
return;
}
uint16_t temp_offset;
if (this->temperature_offset_ > 0) {
temp_offset = (this->temperature_offset_ * 100);
} else {
temp_offset = 0;
}

if (!this->write_command(SCD30_CMD_TEMPERATURE_OFFSET, temp_offset)) {
ESP_LOGE(TAG, "Sensor SCD30 error setting temperature offset.");
this->error_code_ = MEASUREMENT_INIT_FAILED;
this->mark_failed();
return;
}
#ifdef USE_ESP32
// According ESP32 clock stretching is typically 30ms and up to 150ms "due to
Expand Down
5 changes: 4 additions & 1 deletion esphome/components/scd30/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,10 @@
cv.int_range(min=0, max=0xFFFF, max_included=False),
),
cv.Optional(CONF_AMBIENT_PRESSURE_COMPENSATION, default=0): cv.pressure,
cv.Optional(CONF_TEMPERATURE_OFFSET): cv.temperature,
cv.Optional(CONF_TEMPERATURE_OFFSET): cv.All(
cv.temperature,
cv.float_range(min=0, max=655.35),
),
cv.Optional(CONF_UPDATE_INTERVAL, default="60s"): cv.All(
cv.positive_time_period_seconds,
cv.Range(
Expand Down
15 changes: 14 additions & 1 deletion esphome/components/script/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@

PARAMETER_TYPE_TRANSLATIONS = {
"string": "std::string",
"boolean": "bool",
}


Expand Down Expand Up @@ -149,6 +150,16 @@ async def to_code(config):
),
)
async def script_execute_action_to_code(config, action_id, template_arg, args):
def convert(type: str):
def converter(value):
if type == "std::string":
return value
if type == "bool":
return cg.RawExpression(str(value).lower())
return cg.RawExpression(str(value))

return converter

async def get_ordered_args(config, script_params):
config_args = config.copy()
config_args.pop(CONF_ID)
Expand All @@ -160,7 +171,9 @@ async def get_ordered_args(config, script_params):
raise EsphomeError(
f"Missing parameter: '{name}' in script.execute {config[CONF_ID]}"
)
arg = await cg.templatable(config_args[name], args, type)
arg = await cg.templatable(
config_args[name], args, type, convert(str(type))
)
script_args.append(arg)
return script_args

Expand Down
Loading