fix formating

This commit is contained in:
Викторов Андрей Германович
2021-08-26 11:16:57 +03:00
parent b6349eece8
commit c62a5a2d92
2 changed files with 2 additions and 2 deletions

View File

@@ -117,7 +117,7 @@ class MegaView(HomeAssistantView):
_data = data.copy() _data = data.copy()
if e.startswith('ext'): if e.startswith('ext'):
idx = e[3:] idx = e[3:]
pt = f'{pt_orig}e{idx}' if not hub.new_naming else f'{pt_orig:02d}e{idx:02d}' pt = f'{pt_orig}e{idx}' if not hub.new_naming else f'{int(pt_orig):02d}e{int(idx):02d}'
_data['pt_orig'] = pt_orig _data['pt_orig'] = pt_orig
_data['value'] = 'ON' if v == '1' else 'OFF' _data['value'] = 'ON' if v == '1' else 'OFF'
_data['m'] = 1 if _data[e] == '0' else 0 # имитация поведения обычного входа, чтобы события обрабатывались аналогично _data['m'] = 1 if _data[e] == '0' else 0 # имитация поведения обычного входа, чтобы события обрабатывались аналогично

View File

@@ -15,5 +15,5 @@
"@andvikt" "@andvikt"
], ],
"issue_tracker": "https://github.com/andvikt/mega_hacs/issues", "issue_tracker": "https://github.com/andvikt/mega_hacs/issues",
"version": "v1.0.9b2" "version": "v1.0.9b3"
} }