Compare commits
15 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c037e95861 | ||
|
|
2e1b35959f | ||
|
|
7f46d9e0f9 | ||
|
|
069b5f81a0 | ||
|
|
3a36d0b13f | ||
|
|
f0760e99b7 | ||
|
|
18fecf8c09 | ||
|
|
414cf1b333 | ||
|
|
d10f891f51 | ||
|
|
b5927322e6 | ||
|
|
1cf4107e1c | ||
|
|
c12408326c | ||
|
|
4434e59e5a | ||
|
|
45180d98f6 | ||
|
|
44494ad18e |
@@ -1,8 +1,6 @@
|
||||
include LICENSE
|
||||
include README.md
|
||||
include requirements.txt
|
||||
include esphome/dashboard/templates/*.html
|
||||
recursive-include esphome/dashboard/static *.ico *.js *.css *.woff* LICENSE
|
||||
recursive-include esphome *.cpp *.h *.tcc
|
||||
recursive-include esphome *.cpp *.h *.tcc *.c
|
||||
recursive-include esphome *.py.script
|
||||
recursive-include esphome LICENSE.txt
|
||||
|
||||
@@ -9,6 +9,7 @@ from esphome.const import (
|
||||
DEVICE_CLASS_POWER,
|
||||
DEVICE_CLASS_VOLTAGE,
|
||||
STATE_CLASS_MEASUREMENT,
|
||||
STATE_CLASS_TOTAL_INCREASING,
|
||||
UNIT_AMPERE,
|
||||
UNIT_KILOWATT_HOURS,
|
||||
UNIT_VOLT,
|
||||
@@ -66,16 +67,19 @@ CONFIG_SCHEMA = (
|
||||
unit_of_measurement=UNIT_KILOWATT_HOURS,
|
||||
accuracy_decimals=3,
|
||||
device_class=DEVICE_CLASS_ENERGY,
|
||||
state_class=STATE_CLASS_TOTAL_INCREASING,
|
||||
),
|
||||
cv.Optional(CONF_ENERGY_2): sensor.sensor_schema(
|
||||
unit_of_measurement=UNIT_KILOWATT_HOURS,
|
||||
accuracy_decimals=3,
|
||||
device_class=DEVICE_CLASS_ENERGY,
|
||||
state_class=STATE_CLASS_TOTAL_INCREASING,
|
||||
),
|
||||
cv.Optional(CONF_ENERGY_TOTAL): sensor.sensor_schema(
|
||||
unit_of_measurement=UNIT_KILOWATT_HOURS,
|
||||
accuracy_decimals=3,
|
||||
device_class=DEVICE_CLASS_ENERGY,
|
||||
state_class=STATE_CLASS_TOTAL_INCREASING,
|
||||
),
|
||||
}
|
||||
)
|
||||
|
||||
@@ -83,11 +83,30 @@ def import_config(
|
||||
raise FileExistsError
|
||||
|
||||
if project_name == "esphome.web":
|
||||
if "esp32c3" in import_url:
|
||||
board = "esp32-c3-devkitm-1"
|
||||
platform = "ESP32"
|
||||
elif "esp32s2" in import_url:
|
||||
board = "esp32-s2-saola-1"
|
||||
platform = "ESP32"
|
||||
elif "esp32s3" in import_url:
|
||||
board = "esp32-s3-devkitc-1"
|
||||
platform = "ESP32"
|
||||
elif "esp32" in import_url:
|
||||
board = "esp32dev"
|
||||
platform = "ESP32"
|
||||
elif "esp8266" in import_url:
|
||||
board = "esp01_1m"
|
||||
platform = "ESP8266"
|
||||
elif "pico-w" in import_url:
|
||||
board = "pico-w"
|
||||
platform = "RP2040"
|
||||
|
||||
kwargs = {
|
||||
"name": name,
|
||||
"friendly_name": friendly_name,
|
||||
"platform": "ESP32" if "esp32" in import_url else "ESP8266",
|
||||
"board": "esp32dev" if "esp32" in import_url else "esp01_1m",
|
||||
"platform": platform,
|
||||
"board": board,
|
||||
"ssid": "!secret wifi_ssid",
|
||||
"psk": "!secret wifi_password",
|
||||
}
|
||||
|
||||
@@ -72,7 +72,7 @@ void MQTTClimateComponent::send_discovery(JsonObject root, mqtt::SendDiscoveryCo
|
||||
// preset_mode_state_topic
|
||||
root[MQTT_PRESET_MODE_STATE_TOPIC] = this->get_preset_state_topic();
|
||||
// presets
|
||||
JsonArray presets = root.createNestedArray("presets");
|
||||
JsonArray presets = root.createNestedArray("preset_modes");
|
||||
if (traits.supports_preset(CLIMATE_PRESET_HOME))
|
||||
presets.add("home");
|
||||
if (traits.supports_preset(CLIMATE_PRESET_AWAY)) {
|
||||
|
||||
@@ -79,7 +79,9 @@ def register_trigger(name, type, data_type):
|
||||
validator = automation.validate_automation(
|
||||
{
|
||||
cv.GenerateID(CONF_TRIGGER_ID): cv.declare_id(type),
|
||||
cv.GenerateID(CONF_RECEIVER_ID): cv.use_id(RemoteReceiverBase),
|
||||
cv.Optional(CONF_RECEIVER_ID): cv.invalid(
|
||||
"This has been removed in ESPHome 2022.3.0 and the trigger attaches directly to the parent receiver."
|
||||
),
|
||||
}
|
||||
)
|
||||
registerer = TRIGGER_REGISTRY.register(f"on_{name}", validator)
|
||||
@@ -87,7 +89,6 @@ def register_trigger(name, type, data_type):
|
||||
def decorator(func):
|
||||
async def new_func(config):
|
||||
var = cg.new_Pvariable(config[CONF_TRIGGER_ID])
|
||||
await register_listener(var, config)
|
||||
await coroutine(func)(var, config)
|
||||
await automation.build_automation(var, [(data_type, "x")], config)
|
||||
return var
|
||||
@@ -223,10 +224,12 @@ async def build_binary_sensor(full_config):
|
||||
|
||||
|
||||
async def build_triggers(full_config):
|
||||
triggers = []
|
||||
for key in TRIGGER_REGISTRY:
|
||||
for config in full_config.get(key, []):
|
||||
func = TRIGGER_REGISTRY[key][0]
|
||||
await func(config)
|
||||
triggers.append(await func(config))
|
||||
return triggers
|
||||
|
||||
|
||||
async def build_dumpers(config):
|
||||
|
||||
@@ -56,7 +56,9 @@ async def to_code(config):
|
||||
for dumper in dumpers:
|
||||
cg.add(var.register_dumper(dumper))
|
||||
|
||||
await remote_base.build_triggers(config)
|
||||
triggers = await remote_base.build_triggers(config)
|
||||
for trigger in triggers:
|
||||
cg.add(var.register_listener(trigger))
|
||||
await cg.register_component(var, config)
|
||||
|
||||
cg.add(var.set_tolerance(config[CONF_TOLERANCE]))
|
||||
|
||||
@@ -38,8 +38,8 @@ void Wiegand::setup() {
|
||||
bool check_eparity(uint64_t value, int start, int length) {
|
||||
int parity = 0;
|
||||
uint64_t mask = 1LL << start;
|
||||
for (int i = 0; i <= length; i++, mask <<= 1) {
|
||||
if (value & i)
|
||||
for (int i = 0; i < length; i++, mask <<= 1) {
|
||||
if (value & mask)
|
||||
parity++;
|
||||
}
|
||||
return !(parity & 1);
|
||||
@@ -48,8 +48,8 @@ bool check_eparity(uint64_t value, int start, int length) {
|
||||
bool check_oparity(uint64_t value, int start, int length) {
|
||||
int parity = 0;
|
||||
uint64_t mask = 1LL << start;
|
||||
for (int i = 0; i <= length; i++, mask <<= 1) {
|
||||
if (value & i)
|
||||
for (int i = 0; i < length; i++, mask <<= 1) {
|
||||
if (value & mask)
|
||||
parity++;
|
||||
}
|
||||
return parity & 1;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
"""Constants used by esphome."""
|
||||
|
||||
__version__ = "2023.2.0"
|
||||
__version__ = "2023.2.4"
|
||||
|
||||
ALLOWED_NAME_CHARS = "abcdefghijklmnopqrstuvwxyz0123456789-_"
|
||||
|
||||
|
||||
@@ -142,7 +142,10 @@ def get_ini_content():
|
||||
# Sort to avoid changing build flags order
|
||||
CORE.add_platformio_option("build_flags", sorted(CORE.build_flags))
|
||||
|
||||
content = f"[env:{CORE.name}]\n"
|
||||
content = "[platformio]\n"
|
||||
content += f"description = ESPHome {__version__}\n"
|
||||
|
||||
content += f"[env:{CORE.name}]\n"
|
||||
content += format_ini(CORE.platformio_options)
|
||||
|
||||
return content
|
||||
|
||||
Reference in New Issue
Block a user