mirror of
https://github.com/esphome/esphome.git
synced 2026-10-02 01:10:22 +00:00
[api] Mark the cursor returning encode helpers nodiscard
A call that drops the returned cursor would silently truncate the message, so the compiler now warns on it and a unit test scans the generated file for the same mistake. Also corrects the outlining comment for ESP8266, where the inline write is a few byte stores rather than one, and the RAW_ENCODE_MAP annotation.
This commit is contained in:
@@ -732,7 +732,7 @@ class UInt64Type(VarintTypeMixin, TypeInfo):
|
||||
return self._get_simple_size_calculation(name, force, "uint64")
|
||||
|
||||
@property
|
||||
def RAW_ENCODE_MAP(self) -> dict[str, str]: # noqa: N802
|
||||
def RAW_ENCODE_MAP(self) -> dict[str, tuple[str, str]]: # noqa: N802
|
||||
if self.mac_address:
|
||||
return {
|
||||
**TypeInfo.RAW_ENCODE_MAP,
|
||||
|
||||
Reference in New Issue
Block a user