async def async_setup_entry(hass, config_entry, async_add_entities):
    'Set up Homekit numbers.'
    hkid = config_entry.data['AccessoryPairingID']
    conn = hass.data[KNOWN_DEVICES][hkid]

    @callback
    def async_add_characteristic(char: Characteristic):
        kwargs = NUMBER_ENTITIES.get(char.type)
        if (not kwargs):
            return False
        info = {'aid': char.service.accessory.aid, 'iid': char.service.iid}
        async_add_entities([HomeKitNumber(conn, info, char, **kwargs)], True)
        return True
    conn.add_char_factory(async_add_characteristic)
Set up Homekit numbers.
async def async_setup_entry(hass, config_entry, async_add_entities):
    
    hkid = config_entry.data['AccessoryPairingID']
    conn = hass.data[KNOWN_DEVICES][hkid]

    @callback
    def async_add_characteristic(char: Characteristic):
        kwargs = NUMBER_ENTITIES.get(char.type)
        if (not kwargs):
            return False
        info = {'aid': char.service.accessory.aid, 'iid': char.service.iid}
        async_add_entities([HomeKitNumber(conn, info, char, **kwargs)], True)
        return True
    conn.add_char_factory(async_add_characteristic)