mirror of
https://github.com/home-assistant/core.git
synced 2025-08-03 12:45:28 +02:00
Reset imap email content state if no email (#35123)
* no-message: If there is no message at all, replace internal state * Apply proposed change * apply black
This commit is contained in:
@@ -230,6 +230,8 @@ class EmailContentSensor(Entity):
|
|||||||
email_message = self._email_reader.read_next()
|
email_message = self._email_reader.read_next()
|
||||||
|
|
||||||
if email_message is None:
|
if email_message is None:
|
||||||
|
self._message = None
|
||||||
|
self._state_attributes = {}
|
||||||
return
|
return
|
||||||
|
|
||||||
if self.sender_allowed(email_message):
|
if self.sender_allowed(email_message):
|
||||||
|
Reference in New Issue
Block a user