minor cleanups

This commit is contained in:
proddy
2020-08-31 21:39:48 +02:00
parent 97b256cd46
commit abfd1ae63a
3 changed files with 4 additions and 5 deletions

View File

@@ -1595,7 +1595,7 @@ class ESP32FirmwareImage(BaseFirmwareImage):
load_file.seek(start) load_file.seek(start)
calc_digest = hashlib.sha256() calc_digest = hashlib.sha256()
calc_digest.update(load_file.read(end - start)) calc_digest.update(load_file.read(end - start))
self.calc_digest = calc_digest.digest() # TODO: decide what to do here? self.calc_digest = calc_digest.digest() # decide what to do here?
self.verify() self.verify()
@@ -1608,7 +1608,7 @@ class ESP32FirmwareImage(BaseFirmwareImage):
return "%s.bin" % (os.path.splitext(input_file)[0]) return "%s.bin" % (os.path.splitext(input_file)[0])
def warn_if_unusual_segment(self, offset, size, is_irom_segment): def warn_if_unusual_segment(self, offset, size, is_irom_segment):
pass # TODO: add warnings for ESP32 segment offset/size combinations that are wrong pass # add warnings for ESP32 segment offset/size combinations that are wrong
def save(self, filename): def save(self, filename):
total_segments = 0 total_segments = 0
@@ -2799,7 +2799,7 @@ class SpiConnectionAction(argparse.Action):
if any([v for v in values if v > 33 or v < 0]): if any([v for v in values if v > 33 or v < 0]):
raise argparse.ArgumentError(self, 'Pin numbers must be in the range 0-33.') raise argparse.ArgumentError(self, 'Pin numbers must be in the range 0-33.')
# encode the pin numbers as a 32-bit integer with packed 6-bit values, the same way ESP32 ROM takes them # encode the pin numbers as a 32-bit integer with packed 6-bit values, the same way ESP32 ROM takes them
# TODO: make this less ESP32 ROM specific somehow... # todo: make this less ESP32 ROM specific somehow...
clk,q,d,hd,cs = values clk,q,d,hd,cs = values
value = (hd << 24) | (cs << 18) | (d << 12) | (q << 6) | clk value = (hd << 24) | (cs << 18) | (d << 12) | (q << 6) | clk
else: else:

View File

@@ -719,7 +719,7 @@ void Boiler::set_max_power(const char * value, const int8_t id) {
write_command(EMS_TYPE_UBAParameters, 2, v); write_command(EMS_TYPE_UBAParameters, 2, v);
} }
// set oiler on hysteresis // set boiler on hysteresis
void Boiler::set_hyst_on(const char * value, const int8_t id) { void Boiler::set_hyst_on(const char * value, const int8_t id) {
int v = 0; int v = 0;
if (!Helpers::value2number(value, v)) { if (!Helpers::value2number(value, v)) {

View File

@@ -317,7 +317,6 @@ void Thermostat::publish_values() {
} }
// send this specific data using the thermostat_data topic // send this specific data using the thermostat_data topic
// if ((mqtt_format_ == MQTT_format::SINGLE) || (mqtt_format_ == MQTT_format::HA)) {
if (mqtt_format_ != MQTT_format::NESTED) { if (mqtt_format_ != MQTT_format::NESTED) {
Mqtt::publish("thermostat_data", doc); Mqtt::publish("thermostat_data", doc);
rootThermostat = doc.to<JsonObject>(); // clear object rootThermostat = doc.to<JsonObject>(); // clear object