mirror of
				https://github.com/esphome/esphome.git
				synced 2025-11-04 09:01:49 +00:00 
			
		
		
		
	Merge remote-tracking branch 'origin/component_iterator' into integration
This commit is contained in:
		@@ -375,7 +375,7 @@ void ComponentIterator::advance() {
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  if (advance_platform) {
 | 
			
		||||
    this->state_ = static_cast<IteratorState>(static_cast<uint32_t>(this->state_) + 1);
 | 
			
		||||
    this->state_ = static_cast<IteratorState>(static_cast<uint16_t>(this->state_) + 1);
 | 
			
		||||
    this->at_ = 0;
 | 
			
		||||
  } else if (success) {
 | 
			
		||||
    this->at_++;
 | 
			
		||||
 
 | 
			
		||||
@@ -93,7 +93,9 @@ class ComponentIterator {
 | 
			
		||||
  virtual bool on_end();
 | 
			
		||||
 | 
			
		||||
 protected:
 | 
			
		||||
  enum class IteratorState {
 | 
			
		||||
  // Iterates over all ESPHome entities (sensors, switches, lights, etc.)
 | 
			
		||||
  // Supports up to 256 entity types and up to 65,535 entities of each type
 | 
			
		||||
  enum class IteratorState : uint8_t {
 | 
			
		||||
    NONE = 0,
 | 
			
		||||
    BEGIN,
 | 
			
		||||
#ifdef USE_BINARY_SENSOR
 | 
			
		||||
@@ -167,7 +169,7 @@ class ComponentIterator {
 | 
			
		||||
#endif
 | 
			
		||||
    MAX,
 | 
			
		||||
  } state_{IteratorState::NONE};
 | 
			
		||||
  size_t at_{0};
 | 
			
		||||
  uint16_t at_{0};  // Supports up to 65,535 entities per type
 | 
			
		||||
  bool include_internal_{false};
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user