Merge of nested IF-IF cases - E-G (#48367)
This commit is contained in:
parent
786023fce4
commit
0d595a2845
13 changed files with 257 additions and 246 deletions
|
@ -90,9 +90,11 @@ class BanSensor(SensorEntity):
|
|||
if len(self.ban_dict[STATE_ALL_BANS]) > 10:
|
||||
self.ban_dict[STATE_ALL_BANS].pop(0)
|
||||
|
||||
elif entry[0] == "Unban":
|
||||
if current_ip in self.ban_dict[STATE_CURRENT_BANS]:
|
||||
self.ban_dict[STATE_CURRENT_BANS].remove(current_ip)
|
||||
elif (
|
||||
entry[0] == "Unban"
|
||||
and current_ip in self.ban_dict[STATE_CURRENT_BANS]
|
||||
):
|
||||
self.ban_dict[STATE_CURRENT_BANS].remove(current_ip)
|
||||
|
||||
if self.ban_dict[STATE_CURRENT_BANS]:
|
||||
self.last_ban = self.ban_dict[STATE_CURRENT_BANS][-1]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue