mirror of
				https://github.com/esphome/esphome.git
				synced 2025-11-04 09:01:49 +00:00 
			
		
		
		
	sm300d2: Accept (undocumented) 0x80 checksum offset. (#2263)
Co-authored-by: Matt Hallacy <github@poptix.net>
This commit is contained in:
		@@ -27,7 +27,8 @@ void SM300D2Sensor::update() {
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  uint16_t calculated_checksum = this->sm300d2_checksum_(response);
 | 
			
		||||
  if (calculated_checksum != response[SM300D2_RESPONSE_LENGTH - 1]) {
 | 
			
		||||
  if ((calculated_checksum != response[SM300D2_RESPONSE_LENGTH - 1]) &&
 | 
			
		||||
      (calculated_checksum - 0x80 != response[SM300D2_RESPONSE_LENGTH - 1])) {
 | 
			
		||||
    ESP_LOGW(TAG, "SM300D2 Checksum doesn't match: 0x%02X!=0x%02X", response[SM300D2_RESPONSE_LENGTH - 1],
 | 
			
		||||
             calculated_checksum);
 | 
			
		||||
    this->status_set_warning();
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user