Pass optional args to 'new_Pvariable' when creating new entities (#3690)

This commit is contained in:
RoboMagus 2022-08-07 21:31:50 +02:00 committed by GitHub
parent cd473e1395
commit 989b7be99b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 8 additions and 8 deletions

View File

@ -483,8 +483,8 @@ async def register_binary_sensor(var, config):
await setup_binary_sensor_core_(var, config) await setup_binary_sensor_core_(var, config)
async def new_binary_sensor(config): async def new_binary_sensor(config, *args):
var = cg.new_Pvariable(config[CONF_ID]) var = cg.new_Pvariable(config[CONF_ID], *args)
await register_binary_sensor(var, config) await register_binary_sensor(var, config)
return var return var

View File

@ -102,8 +102,8 @@ async def register_button(var, config):
await setup_button_core_(var, config) await setup_button_core_(var, config)
async def new_button(config): async def new_button(config, *args):
var = cg.new_Pvariable(config[CONF_ID]) var = cg.new_Pvariable(config[CONF_ID], *args)
await register_button(var, config) await register_button(var, config)
return var return var

View File

@ -614,8 +614,8 @@ async def register_sensor(var, config):
await setup_sensor_core_(var, config) await setup_sensor_core_(var, config)
async def new_sensor(config): async def new_sensor(config, *args):
var = cg.new_Pvariable(config[CONF_ID]) var = cg.new_Pvariable(config[CONF_ID], *args)
await register_sensor(var, config) await register_sensor(var, config)
return var return var

View File

@ -189,8 +189,8 @@ async def register_text_sensor(var, config):
await setup_text_sensor_core_(var, config) await setup_text_sensor_core_(var, config)
async def new_text_sensor(config): async def new_text_sensor(config, *args):
var = cg.new_Pvariable(config[CONF_ID]) var = cg.new_Pvariable(config[CONF_ID], *args)
await register_text_sensor(var, config) await register_text_sensor(var, config)
return var return var