OpenEPaperLink / Home_Assistant_Integration

Home assistant Integration for the OpenEPaperLink project
Apache License 2.0
133 stars 32 forks source link

Use dict.get() with default values to shorten code #82

Closed jonasc closed 6 months ago

jonasc commented 6 months ago

A suggestion to shorten the code by converting lots of uses of

if "var" not in element:
    var = default_value
else:
    var = element["var"]

to

var = element.get("var", default_value)