import esphome.codegen as cg speed_ns = cg.esphome_ns.namespace('speed')