1
0
mirror of https://github.com/esphome/esphome.git synced 2025-06-18 14:25:48 +01:00

Remove last_reset_type and convert all those sensors to TOTAL_INCREASING ()

This commit is contained in:
Jesse Hills
2021-09-06 08:30:47 +12:00
committed by GitHub
parent f9b0666adf
commit ff6bed54c6
22 changed files with 60 additions and 191 deletions
esphome
script/api_protobuf

@ -778,9 +778,9 @@ def build_service_message_type(mt):
hout += f"bool {func}(const {mt.name} &msg);\n"
cout += f"bool {class_name}::{func}(const {mt.name} &msg) {{\n"
if log:
cout += f'#ifdef HAS_PROTO_MESSAGE_DUMP\n'
cout += f"#ifdef HAS_PROTO_MESSAGE_DUMP\n"
cout += f' ESP_LOGVV(TAG, "{func}: %s", msg.dump().c_str());\n'
cout += f'#endif\n'
cout += f"#endif\n"
# cout += f' this->set_nodelay({str(nodelay).lower()});\n'
cout += f" return this->send_message_<{mt.name}>(msg, {id_});\n"
cout += f"}}\n"
@ -794,9 +794,9 @@ def build_service_message_type(mt):
case += f"{mt.name} msg;\n"
case += f"msg.decode(msg_data, msg_size);\n"
if log:
case += f'#ifdef HAS_PROTO_MESSAGE_DUMP\n'
case += f"#ifdef HAS_PROTO_MESSAGE_DUMP\n"
case += f'ESP_LOGVV(TAG, "{func}: %s", msg.dump().c_str());\n'
case += f'#endif\n'
case += f"#endif\n"
case += f"this->{func}(msg);\n"
if ifdef is not None:
case += f"#endif\n"