Files
mega_hacs/custom_components/mega/tools.py
2021-01-27 21:40:55 +03:00

12 lines
278 B
Python

_params = ['m', 'click', 'cnt', 'pt']
def make_ints(d: dict):
for x in _params:
try:
d[x] = int(d.get(x, 0))
except (ValueError, TypeError):
pass
if 'm' not in d:
d['m'] = 0
if 'click' not in d:
d['click'] = 0