@@ -264,23 +264,23 @@ async def to_code(config):
264264 cg .add (var .set_power_only_above_5v (config [CONF_POWER_ONLY_ABOVE_5V ]))
265265
266266
267- # # Actions
268- # TurnGpioOn = stusb4500_ns.class_("TurnGpioOn", automation.Action)
269- # TurnGpioOff = stusb4500_ns.class_("TurnGpioOff", automation.Action)
267+ # Actions
268+ TurnGpioOn = stusb4500_ns .class_ ("TurnGpioOn" , automation .Action )
269+ TurnGpioOff = stusb4500_ns .class_ ("TurnGpioOff" , automation .Action )
270270
271- # STUSB4500_ACTION_SCHEMA = maybe_simple_id(
272- # {
273- # cv.Required(CONF_ID): cv.use_id(STUSB4500Hub),
274- # }
275- # )
271+ STUSB4500_ACTION_SCHEMA = maybe_simple_id (
272+ {
273+ cv .Required (CONF_ID ): cv .use_id (STUSB4500Hub ),
274+ }
275+ )
276276
277277
278- # @automation.register_action(
279- # "stusb4500.turn_gpio_on", TurnGpioOn, STUSB4500_ACTION_SCHEMA
280- # )
281- # @automation.register_action(
282- # "stusb4500.turn_gpio_off", TurnGpioOff, STUSB4500_ACTION_SCHEMA
283- # )
284- # async def stusb4500_fan_to_code(config, action_id, template_arg, args):
285- # paren = await cg.get_variable(config[CONF_ID])
286- # return cg.new_Pvariable(action_id, template_arg, paren)
278+ @automation .register_action (
279+ "stusb4500.turn_gpio_on" , TurnGpioOn , STUSB4500_ACTION_SCHEMA
280+ )
281+ @automation .register_action (
282+ "stusb4500.turn_gpio_off" , TurnGpioOff , STUSB4500_ACTION_SCHEMA
283+ )
284+ async def stusb4500_fan_to_code (config , action_id , template_arg , args ):
285+ paren = await cg .get_variable (config [CONF_ID ])
286+ return cg .new_Pvariable (action_id , template_arg , paren )
0 commit comments