diff --git a/homeassistant/components/sandbox/_proto/sandbox_pb2.py b/homeassistant/components/sandbox/_proto/sandbox_pb2.py index 536b77d3ea1d..937871283362 100644 --- a/homeassistant/components/sandbox/_proto/sandbox_pb2.py +++ b/homeassistant/components/sandbox/_proto/sandbox_pb2.py @@ -24,7 +24,7 @@ _sym_db = _symbol_database.Default() -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\rsandbox.proto\x12\x07sandbox\"c\n\x05\x46rame\x12\n\n\x02id\x18\x01 \x01(\r\x12\x0c\n\x04type\x18\x02 \x01(\t\x12\x11\n\x07request\x18\x03 \x01(\x0cH\x00\x12%\n\x08response\x18\x04 \x01(\x0b\x32\x11.sandbox.ResponseH\x00\x42\x06\n\x04\x62ody\"E\n\x08Response\x12\n\n\x02ok\x18\x01 \x01(\x08\x12\x0e\n\x06result\x18\x02 \x01(\x0c\x12\x1d\n\x05\x65rror\x18\x03 \x01(\x0b\x32\x0e.sandbox.Error\"`\n\x05\x45rror\x12\x0f\n\x07message\x18\x01 \x01(\t\x12\x0c\n\x04type\x18\x02 \x01(\t\x12&\n\x07invalid\x18\x03 \x03(\x0b\x32\x15.sandbox.InvalidError\x12\x10\n\x08multiple\x18\x04 \x01(\x08\"-\n\x0cInvalidError\x12\x0f\n\x07message\x18\x01 \x01(\t\x12\x0c\n\x04path\x18\x02 \x03(\t\"(\n\nDevicePair\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t\"\xcc\x03\n\nDeviceInfo\x12(\n\x0bidentifiers\x18\x01 \x03(\x0b\x32\x13.sandbox.DevicePair\x12(\n\x0b\x63onnections\x18\x02 \x03(\x0b\x32\x13.sandbox.DevicePair\x12,\n\nvia_device\x18\x03 \x01(\x0b\x32\x13.sandbox.DevicePairH\x00\x88\x01\x01\x12\x12\n\nentry_type\x18\x04 \x01(\t\x12\x0c\n\x04name\x18\x05 \x01(\t\x12\x14\n\x0cmanufacturer\x18\x06 \x01(\t\x12\r\n\x05model\x18\x07 \x01(\t\x12\x10\n\x08model_id\x18\x08 \x01(\t\x12\x12\n\nsw_version\x18\t \x01(\t\x12\x12\n\nhw_version\x18\n \x01(\t\x12\x15\n\rserial_number\x18\x0b \x01(\t\x12\x16\n\x0esuggested_area\x18\x0c \x01(\t\x12\x19\n\x11\x63onfiguration_url\x18\r \x01(\t\x12\x14\n\x0c\x64\x65\x66\x61ult_name\x18\x0e \x01(\t\x12\x1c\n\x14\x64\x65\x66\x61ult_manufacturer\x18\x0f \x01(\t\x12\x15\n\rdefault_model\x18\x10 \x01(\t\x12\x17\n\x0ftranslation_key\x18\x11 \x01(\tB\r\n\x0b_via_device\"h\n\x11IntegrationSource\x12\x0c\n\x04kind\x18\x01 \x01(\t\x12\x0b\n\x03url\x18\x02 \x01(\t\x12\x0b\n\x03ref\x18\x03 \x01(\t\x12\x0b\n\x03tag\x18\x04 \x01(\t\x12\x0e\n\x06\x64omain\x18\x05 \x01(\t\x12\x0e\n\x06subdir\x18\x06 \x01(\t\"\xe4\x02\n\nCoreConfig\x12\x15\n\x08latitude\x18\x01 \x01(\x01H\x00\x88\x01\x01\x12\x16\n\tlongitude\x18\x02 \x01(\x01H\x01\x88\x01\x01\x12\x16\n\televation\x18\x03 \x01(\x01H\x02\x88\x01\x01\x12\x16\n\ttime_zone\x18\x04 \x01(\tH\x03\x88\x01\x01\x12\x18\n\x0bunit_system\x18\x05 \x01(\tH\x04\x88\x01\x01\x12\x15\n\x08language\x18\x06 \x01(\tH\x05\x88\x01\x01\x12\x14\n\x07\x63ountry\x18\x07 \x01(\tH\x06\x88\x01\x01\x12\x15\n\x08\x63urrency\x18\x08 \x01(\tH\x07\x88\x01\x01\x12\x1a\n\rlocation_name\x18\t \x01(\tH\x08\x88\x01\x01\x42\x0b\n\t_latitudeB\x0c\n\n_longitudeB\x0c\n\n_elevationB\x0c\n\n_time_zoneB\x0e\n\x0c_unit_systemB\x0b\n\t_languageB\n\n\x08_countryB\x0b\n\t_currencyB\x10\n\x0e_location_name\"\x9c\x02\n\nEntrySetup\x12\x10\n\x08\x65ntry_id\x18\x01 \x01(\t\x12\x0e\n\x06\x64omain\x18\x02 \x01(\t\x12\r\n\x05title\x18\x03 \x01(\t\x12\x0c\n\x04\x64\x61ta\x18\x04 \x01(\x0c\x12\x0f\n\x07options\x18\x05 \x01(\x0c\x12\x0e\n\x06source\x18\x06 \x01(\t\x12\x16\n\tunique_id\x18\x07 \x01(\tH\x00\x88\x01\x01\x12\x0f\n\x07version\x18\x08 \x01(\x05\x12\x15\n\rminor_version\x18\t \x01(\x05\x12\x36\n\x12integration_source\x18\n \x01(\x0b\x32\x1a.sandbox.IntegrationSource\x12(\n\x0b\x63ore_config\x18\x0b \x01(\x0b\x32\x13.sandbox.CoreConfigB\x0c\n\n_unique_id\">\n\x10\x45ntrySetupResult\x12\n\n\x02ok\x18\x01 \x01(\x08\x12\x13\n\x06reason\x18\x02 \x01(\tH\x00\x88\x01\x01\x42\t\n\x07_reason\"\x1f\n\x0b\x45ntryUnload\x12\x10\n\x08\x65ntry_id\x18\x01 \x01(\t\"\x1f\n\x11\x45ntryUnloadResult\x12\n\n\x02ok\x18\x01 \x01(\x08\"\x95\x01\n\x0b\x43\x61llService\x12\x0e\n\x06\x64omain\x18\x01 \x01(\t\x12\x0f\n\x07service\x18\x02 \x01(\t\x12\x0e\n\x06target\x18\x03 \x01(\x0c\x12\x14\n\x0cservice_data\x18\x04 \x01(\x0c\x12\x17\n\ncontext_id\x18\x05 \x01(\tH\x00\x88\x01\x01\x12\x17\n\x0freturn_response\x18\x06 \x01(\x08\x42\r\n\x0b_context_id\"\x1f\n\x0fServiceResponse\x12\x0c\n\x04\x64\x61ta\x18\x01 \x01(\x0c\"Q\n\x11\x43\x61llServiceResult\x12/\n\x08response\x18\x01 \x01(\x0b\x32\x18.sandbox.ServiceResponseH\x00\x88\x01\x01\x42\x0b\n\t_response\"n\n\x0b\x45ntityQuery\x12\x19\n\x11sandbox_entity_id\x18\x01 \x01(\t\x12\x0e\n\x06method\x18\x02 \x01(\t\x12\x0c\n\x04\x61rgs\x18\x03 \x01(\x0c\x12\x17\n\ncontext_id\x18\x04 \x01(\tH\x00\x88\x01\x01\x42\r\n\x0b_context_id\"#\n\x11\x45ntityQueryResult\x12\x0e\n\x06result\x18\x01 \x01(\x0c\"4\n\x0fGetTranslations\x12\x10\n\x08language\x18\x01 \x01(\t\x12\x0f\n\x07\x64omains\x18\x02 \x03(\t\":\n\x15GetTranslationsResult\x12\x10\n\x08language\x18\x01 \x01(\t\x12\x0f\n\x07strings\x18\x02 \x01(\x0c\"\n\n\x08Shutdown\"\\\n\x0eShutdownResult\x12\n\n\x02ok\x18\x01 \x01(\x08\x12\x10\n\x08unloaded\x18\x02 \x01(\x05\x12\x1a\n\rrestore_state\x18\x03 \x01(\x0cH\x00\x88\x01\x01\x42\x10\n\x0e_restore_state\"\x06\n\x04Ping\"\x1a\n\nPingResult\x12\x0c\n\x04pong\x18\x01 \x01(\t\"\x07\n\x05Ready\"H\n\x08\x46lowInit\x12\x0f\n\x07handler\x18\x01 \x01(\t\x12\x0f\n\x07\x63ontext\x18\x02 \x01(\x0c\x12\x11\n\x04\x64\x61ta\x18\x03 \x01(\x0cH\x00\x88\x01\x01\x42\x07\n\x05_data\"C\n\x08\x46lowStep\x12\x0f\n\x07\x66low_id\x18\x01 \x01(\t\x12\x17\n\nuser_input\x18\x02 \x01(\x0cH\x00\x88\x01\x01\x42\r\n\x0b_user_input\"\x1c\n\tFlowAbort\x12\x0f\n\x07\x66low_id\x18\x01 \x01(\t\"\x11\n\x0f\x46lowAbortResult\"\x96\x05\n\nFlowResult\x12\x0c\n\x04type\x18\x01 \x01(\t\x12\x14\n\x07\x66low_id\x18\x02 \x01(\tH\x00\x88\x01\x01\x12\x14\n\x07handler\x18\x03 \x01(\tH\x01\x88\x01\x01\x12\x14\n\x07step_id\x18\x04 \x01(\tH\x02\x88\x01\x01\x12\x13\n\x06reason\x18\x05 \x01(\tH\x03\x88\x01\x01\x12\x12\n\x05title\x18\x06 \x01(\tH\x04\x88\x01\x01\x12\x18\n\x0b\x64\x65scription\x18\x07 \x01(\tH\x05\x88\x01\x01\x12\x16\n\tlast_step\x18\x08 \x01(\x08H\x06\x88\x01\x01\x12\x14\n\x07preview\x18\t \x01(\tH\x07\x88\x01\x01\x12\x14\n\x07version\x18\n \x01(\x05H\x08\x88\x01\x01\x12\x1a\n\rminor_version\x18\x0b \x01(\x05H\t\x88\x01\x01\x12\x0c\n\x04\x64\x61ta\x18\x0c \x01(\x0c\x12\x14\n\x07options\x18\r \x01(\x0cH\n\x88\x01\x01\x12\x13\n\x06\x65rrors\x18\x0e \x01(\x0cH\x0b\x88\x01\x01\x12%\n\x18\x64\x65scription_placeholders\x18\x0f \x01(\x0cH\x0c\x88\x01\x01\x12\x14\n\x07\x63ontext\x18\x10 \x01(\x0cH\r\x88\x01\x01\x12\x13\n\x0b\x64\x61ta_schema\x18\x11 \x01(\x0c\x12\x17\n\x0fhas_data_schema\x18\x12 \x01(\x08\x12\x14\n\x0cmenu_options\x18\x13 \x01(\x0c\x12\x11\n\x04sort\x18\x14 \x01(\x08H\x0e\x88\x01\x01\x42\n\n\x08_flow_idB\n\n\x08_handlerB\n\n\x08_step_idB\t\n\x07_reasonB\x08\n\x06_titleB\x0e\n\x0c_descriptionB\x0c\n\n_last_stepB\n\n\x08_previewB\n\n\x08_versionB\x10\n\x0e_minor_versionB\n\n\x08_optionsB\t\n\x07_errorsB\x1b\n\x19_description_placeholdersB\n\n\x08_contextB\x07\n\x05_sort\"\x8a\x03\n\nEntityInfo\x12\x39\n\x0b\x64\x65scription\x18\x01 \x01(\x0b\x32\x1f.sandbox.EntityInfo.DescriptionH\x00\x88\x01\x01\x12-\n\x0b\x64\x65vice_info\x18\x02 \x01(\x0b\x32\x13.sandbox.DeviceInfoH\x01\x88\x01\x01\x1a\xf1\x01\n\x0b\x44\x65scription\x12\x11\n\x04name\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x11\n\x04icon\x18\x02 \x01(\tH\x01\x88\x01\x01\x12\x1c\n\x0f\x65ntity_category\x18\x03 \x01(\tH\x02\x88\x01\x01\x12\x19\n\x0c\x64\x65vice_class\x18\x04 \x01(\tH\x03\x88\x01\x01\x12\x1a\n\x12supported_features\x18\x05 \x01(\x05\x12\x1c\n\x0ftranslation_key\x18\x06 \x01(\tH\x04\x88\x01\x01\x42\x07\n\x05_nameB\x07\n\x05_iconB\x12\n\x10_entity_categoryB\x0f\n\r_device_classB\x12\n\x10_translation_keyB\x0e\n\x0c_descriptionB\x0e\n\x0c_device_info\"V\n\x0cInitialState\x12\x12\n\x05state\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x14\n\x0c\x63\x61pabilities\x18\x02 \x01(\x0c\x12\x12\n\nattributes\x18\x03 \x01(\x0c\x42\x08\n\x06_state\"\xda\x01\n\x11\x45ntityDescription\x12\x10\n\x08\x65ntry_id\x18\x01 \x01(\t\x12\x0e\n\x06\x64omain\x18\x02 \x01(\t\x12\x19\n\x11sandbox_entity_id\x18\x03 \x01(\t\x12\x16\n\tunique_id\x18\x04 \x01(\tH\x00\x88\x01\x01\x12\x17\n\x0fhas_entity_name\x18\x05 \x01(\x08\x12!\n\x04info\x18\x06 \x01(\x0b\x32\x13.sandbox.EntityInfo\x12&\n\x07initial\x18\x07 \x01(\x0b\x32\x15.sandbox.InitialStateB\x0c\n\n_unique_id\")\n\x14RegisterEntityResult\x12\x11\n\tentity_id\x18\x01 \x01(\t\"-\n\x10UnregisterEntity\x12\x19\n\x11sandbox_entity_id\x18\x01 \x01(\t\"$\n\x16UnregisterEntityResult\x12\n\n\x02ok\x18\x01 \x01(\x08\"\x83\x01\n\x0cStateChanged\x12\x19\n\x11sandbox_entity_id\x18\x01 \x01(\t\x12\x12\n\x05state\x18\x02 \x01(\tH\x00\x88\x01\x01\x12\x12\n\nattributes\x18\x03 \x01(\x0c\x12\x17\n\ncontext_id\x18\x04 \x01(\tH\x01\x88\x01\x01\x42\x08\n\x06_stateB\r\n\x0b_context_id\"]\n\x0fRegisterService\x12\x0e\n\x06\x64omain\x18\x01 \x01(\t\x12\x0f\n\x07service\x18\x02 \x01(\t\x12\x19\n\x11supports_response\x18\x03 \x01(\t\x12\x0e\n\x06schema\x18\x04 \x01(\x0c\"6\n\x15RegisterServiceResult\x12\n\n\x02ok\x18\x01 \x01(\x08\x12\x11\n\tinstalled\x18\x02 \x01(\x08\"4\n\x11UnregisterService\x12\x0e\n\x06\x64omain\x18\x01 \x01(\t\x12\x0f\n\x07service\x18\x02 \x01(\t\"6\n\x17UnregisterServiceResult\x12\n\n\x02ok\x18\x01 \x01(\x08\x12\x0f\n\x07removed\x18\x02 \x01(\x08\"[\n\tFireEvent\x12\x12\n\nevent_type\x18\x01 \x01(\t\x12\x12\n\nevent_data\x18\x02 \x01(\x0c\x12\x17\n\ncontext_id\x18\x03 \x01(\tH\x00\x88\x01\x01\x42\r\n\x0b_context_id\"\x18\n\tStoreLoad\x12\x0b\n\x03key\x18\x01 \x01(\t\"-\n\x0fStoreLoadResult\x12\x11\n\x04\x64\x61ta\x18\x01 \x01(\x0cH\x00\x88\x01\x01\x42\x07\n\x05_data\"&\n\tStoreSave\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x0c\n\x04\x64\x61ta\x18\x02 \x01(\x0c\"\x1d\n\x0fStoreSaveResult\x12\n\n\x02ok\x18\x01 \x01(\x08\"\x1a\n\x0bStoreRemove\x12\x0b\n\x03key\x18\x01 \x01(\t\"\x1f\n\x11StoreRemoveResult\x12\n\n\x02ok\x18\x01 \x01(\x08\x62\x06proto3') +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\rsandbox.proto\x12\x07sandbox\"c\n\x05\x46rame\x12\n\n\x02id\x18\x01 \x01(\r\x12\x0c\n\x04type\x18\x02 \x01(\t\x12\x11\n\x07request\x18\x03 \x01(\x0cH\x00\x12%\n\x08response\x18\x04 \x01(\x0b\x32\x11.sandbox.ResponseH\x00\x42\x06\n\x04\x62ody\"E\n\x08Response\x12\n\n\x02ok\x18\x01 \x01(\x08\x12\x0e\n\x06result\x18\x02 \x01(\x0c\x12\x1d\n\x05\x65rror\x18\x03 \x01(\x0b\x32\x0e.sandbox.Error\"`\n\x05\x45rror\x12\x0f\n\x07message\x18\x01 \x01(\t\x12\x0c\n\x04type\x18\x02 \x01(\t\x12&\n\x07invalid\x18\x03 \x03(\x0b\x32\x15.sandbox.InvalidError\x12\x10\n\x08multiple\x18\x04 \x01(\x08\"-\n\x0cInvalidError\x12\x0f\n\x07message\x18\x01 \x01(\t\x12\x0c\n\x04path\x18\x02 \x03(\t\"(\n\nDevicePair\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t\"\xcc\x03\n\nDeviceInfo\x12(\n\x0bidentifiers\x18\x01 \x03(\x0b\x32\x13.sandbox.DevicePair\x12(\n\x0b\x63onnections\x18\x02 \x03(\x0b\x32\x13.sandbox.DevicePair\x12,\n\nvia_device\x18\x03 \x01(\x0b\x32\x13.sandbox.DevicePairH\x00\x88\x01\x01\x12\x12\n\nentry_type\x18\x04 \x01(\t\x12\x0c\n\x04name\x18\x05 \x01(\t\x12\x14\n\x0cmanufacturer\x18\x06 \x01(\t\x12\r\n\x05model\x18\x07 \x01(\t\x12\x10\n\x08model_id\x18\x08 \x01(\t\x12\x12\n\nsw_version\x18\t \x01(\t\x12\x12\n\nhw_version\x18\n \x01(\t\x12\x15\n\rserial_number\x18\x0b \x01(\t\x12\x16\n\x0esuggested_area\x18\x0c \x01(\t\x12\x19\n\x11\x63onfiguration_url\x18\r \x01(\t\x12\x14\n\x0c\x64\x65\x66\x61ult_name\x18\x0e \x01(\t\x12\x1c\n\x14\x64\x65\x66\x61ult_manufacturer\x18\x0f \x01(\t\x12\x15\n\rdefault_model\x18\x10 \x01(\t\x12\x17\n\x0ftranslation_key\x18\x11 \x01(\tB\r\n\x0b_via_device\"h\n\x11IntegrationSource\x12\x0c\n\x04kind\x18\x01 \x01(\t\x12\x0b\n\x03url\x18\x02 \x01(\t\x12\x0b\n\x03ref\x18\x03 \x01(\t\x12\x0b\n\x03tag\x18\x04 \x01(\t\x12\x0e\n\x06\x64omain\x18\x05 \x01(\t\x12\x0e\n\x06subdir\x18\x06 \x01(\t\"\xe4\x02\n\nCoreConfig\x12\x15\n\x08latitude\x18\x01 \x01(\x01H\x00\x88\x01\x01\x12\x16\n\tlongitude\x18\x02 \x01(\x01H\x01\x88\x01\x01\x12\x16\n\televation\x18\x03 \x01(\x01H\x02\x88\x01\x01\x12\x16\n\ttime_zone\x18\x04 \x01(\tH\x03\x88\x01\x01\x12\x18\n\x0bunit_system\x18\x05 \x01(\tH\x04\x88\x01\x01\x12\x15\n\x08language\x18\x06 \x01(\tH\x05\x88\x01\x01\x12\x14\n\x07\x63ountry\x18\x07 \x01(\tH\x06\x88\x01\x01\x12\x15\n\x08\x63urrency\x18\x08 \x01(\tH\x07\x88\x01\x01\x12\x1a\n\rlocation_name\x18\t \x01(\tH\x08\x88\x01\x01\x42\x0b\n\t_latitudeB\x0c\n\n_longitudeB\x0c\n\n_elevationB\x0c\n\n_time_zoneB\x0e\n\x0c_unit_systemB\x0b\n\t_languageB\n\n\x08_countryB\x0b\n\t_currencyB\x10\n\x0e_location_name\"\x9c\x02\n\nEntrySetup\x12\x10\n\x08\x65ntry_id\x18\x01 \x01(\t\x12\x0e\n\x06\x64omain\x18\x02 \x01(\t\x12\r\n\x05title\x18\x03 \x01(\t\x12\x0c\n\x04\x64\x61ta\x18\x04 \x01(\x0c\x12\x0f\n\x07options\x18\x05 \x01(\x0c\x12\x0e\n\x06source\x18\x06 \x01(\t\x12\x16\n\tunique_id\x18\x07 \x01(\tH\x00\x88\x01\x01\x12\x0f\n\x07version\x18\x08 \x01(\x05\x12\x15\n\rminor_version\x18\t \x01(\x05\x12\x36\n\x12integration_source\x18\n \x01(\x0b\x32\x1a.sandbox.IntegrationSource\x12(\n\x0b\x63ore_config\x18\x0b \x01(\x0b\x32\x13.sandbox.CoreConfigB\x0c\n\n_unique_id\">\n\x10\x45ntrySetupResult\x12\n\n\x02ok\x18\x01 \x01(\x08\x12\x13\n\x06reason\x18\x02 \x01(\tH\x00\x88\x01\x01\x42\t\n\x07_reason\"\x1f\n\x0b\x45ntryUnload\x12\x10\n\x08\x65ntry_id\x18\x01 \x01(\t\"\x1f\n\x11\x45ntryUnloadResult\x12\n\n\x02ok\x18\x01 \x01(\x08\"\x95\x01\n\x0b\x43\x61llService\x12\x0e\n\x06\x64omain\x18\x01 \x01(\t\x12\x0f\n\x07service\x18\x02 \x01(\t\x12\x0e\n\x06target\x18\x03 \x01(\x0c\x12\x14\n\x0cservice_data\x18\x04 \x01(\x0c\x12\x17\n\ncontext_id\x18\x05 \x01(\tH\x00\x88\x01\x01\x12\x17\n\x0freturn_response\x18\x06 \x01(\x08\x42\r\n\x0b_context_id\"\x1f\n\x0fServiceResponse\x12\x0c\n\x04\x64\x61ta\x18\x01 \x01(\x0c\"Q\n\x11\x43\x61llServiceResult\x12/\n\x08response\x18\x01 \x01(\x0b\x32\x18.sandbox.ServiceResponseH\x00\x88\x01\x01\x42\x0b\n\t_response\"n\n\x0b\x45ntityQuery\x12\x19\n\x11sandbox_entity_id\x18\x01 \x01(\t\x12\x0e\n\x06method\x18\x02 \x01(\t\x12\x0c\n\x04\x61rgs\x18\x03 \x01(\x0c\x12\x17\n\ncontext_id\x18\x04 \x01(\tH\x00\x88\x01\x01\x42\r\n\x0b_context_id\"#\n\x11\x45ntityQueryResult\x12\x0e\n\x06result\x18\x01 \x01(\x0c\"4\n\x0fGetTranslations\x12\x10\n\x08language\x18\x01 \x01(\t\x12\x0f\n\x07\x64omains\x18\x02 \x03(\t\":\n\x15GetTranslationsResult\x12\x10\n\x08language\x18\x01 \x01(\t\x12\x0f\n\x07strings\x18\x02 \x01(\x0c\"\n\n\x08Shutdown\"\\\n\x0eShutdownResult\x12\n\n\x02ok\x18\x01 \x01(\x08\x12\x10\n\x08unloaded\x18\x02 \x01(\x05\x12\x1a\n\rrestore_state\x18\x03 \x01(\x0cH\x00\x88\x01\x01\x42\x10\n\x0e_restore_state\"\x06\n\x04Ping\"\x1a\n\nPingResult\x12\x0c\n\x04pong\x18\x01 \x01(\t\"\x07\n\x05Ready\"{\n\x08\x46lowInit\x12\x0f\n\x07handler\x18\x01 \x01(\t\x12\x0f\n\x07\x63ontext\x18\x02 \x01(\x0c\x12\x11\n\x04\x64\x61ta\x18\x03 \x01(\x0cH\x00\x88\x01\x01\x12\'\n\x05\x65ntry\x18\x04 \x01(\x0b\x32\x13.sandbox.EntrySetupH\x01\x88\x01\x01\x42\x07\n\x05_dataB\x08\n\x06_entry\"C\n\x08\x46lowStep\x12\x0f\n\x07\x66low_id\x18\x01 \x01(\t\x12\x17\n\nuser_input\x18\x02 \x01(\x0cH\x00\x88\x01\x01\x42\r\n\x0b_user_input\"\x1c\n\tFlowAbort\x12\x0f\n\x07\x66low_id\x18\x01 \x01(\t\"\x11\n\x0f\x46lowAbortResult\"\x96\x05\n\nFlowResult\x12\x0c\n\x04type\x18\x01 \x01(\t\x12\x14\n\x07\x66low_id\x18\x02 \x01(\tH\x00\x88\x01\x01\x12\x14\n\x07handler\x18\x03 \x01(\tH\x01\x88\x01\x01\x12\x14\n\x07step_id\x18\x04 \x01(\tH\x02\x88\x01\x01\x12\x13\n\x06reason\x18\x05 \x01(\tH\x03\x88\x01\x01\x12\x12\n\x05title\x18\x06 \x01(\tH\x04\x88\x01\x01\x12\x18\n\x0b\x64\x65scription\x18\x07 \x01(\tH\x05\x88\x01\x01\x12\x16\n\tlast_step\x18\x08 \x01(\x08H\x06\x88\x01\x01\x12\x14\n\x07preview\x18\t \x01(\tH\x07\x88\x01\x01\x12\x14\n\x07version\x18\n \x01(\x05H\x08\x88\x01\x01\x12\x1a\n\rminor_version\x18\x0b \x01(\x05H\t\x88\x01\x01\x12\x0c\n\x04\x64\x61ta\x18\x0c \x01(\x0c\x12\x14\n\x07options\x18\r \x01(\x0cH\n\x88\x01\x01\x12\x13\n\x06\x65rrors\x18\x0e \x01(\x0cH\x0b\x88\x01\x01\x12%\n\x18\x64\x65scription_placeholders\x18\x0f \x01(\x0cH\x0c\x88\x01\x01\x12\x14\n\x07\x63ontext\x18\x10 \x01(\x0cH\r\x88\x01\x01\x12\x13\n\x0b\x64\x61ta_schema\x18\x11 \x01(\x0c\x12\x17\n\x0fhas_data_schema\x18\x12 \x01(\x08\x12\x14\n\x0cmenu_options\x18\x13 \x01(\x0c\x12\x11\n\x04sort\x18\x14 \x01(\x08H\x0e\x88\x01\x01\x42\n\n\x08_flow_idB\n\n\x08_handlerB\n\n\x08_step_idB\t\n\x07_reasonB\x08\n\x06_titleB\x0e\n\x0c_descriptionB\x0c\n\n_last_stepB\n\n\x08_previewB\n\n\x08_versionB\x10\n\x0e_minor_versionB\n\n\x08_optionsB\t\n\x07_errorsB\x1b\n\x19_description_placeholdersB\n\n\x08_contextB\x07\n\x05_sort\"\x8a\x03\n\nEntityInfo\x12\x39\n\x0b\x64\x65scription\x18\x01 \x01(\x0b\x32\x1f.sandbox.EntityInfo.DescriptionH\x00\x88\x01\x01\x12-\n\x0b\x64\x65vice_info\x18\x02 \x01(\x0b\x32\x13.sandbox.DeviceInfoH\x01\x88\x01\x01\x1a\xf1\x01\n\x0b\x44\x65scription\x12\x11\n\x04name\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x11\n\x04icon\x18\x02 \x01(\tH\x01\x88\x01\x01\x12\x1c\n\x0f\x65ntity_category\x18\x03 \x01(\tH\x02\x88\x01\x01\x12\x19\n\x0c\x64\x65vice_class\x18\x04 \x01(\tH\x03\x88\x01\x01\x12\x1a\n\x12supported_features\x18\x05 \x01(\x05\x12\x1c\n\x0ftranslation_key\x18\x06 \x01(\tH\x04\x88\x01\x01\x42\x07\n\x05_nameB\x07\n\x05_iconB\x12\n\x10_entity_categoryB\x0f\n\r_device_classB\x12\n\x10_translation_keyB\x0e\n\x0c_descriptionB\x0e\n\x0c_device_info\"V\n\x0cInitialState\x12\x12\n\x05state\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x14\n\x0c\x63\x61pabilities\x18\x02 \x01(\x0c\x12\x12\n\nattributes\x18\x03 \x01(\x0c\x42\x08\n\x06_state\"\xda\x01\n\x11\x45ntityDescription\x12\x10\n\x08\x65ntry_id\x18\x01 \x01(\t\x12\x0e\n\x06\x64omain\x18\x02 \x01(\t\x12\x19\n\x11sandbox_entity_id\x18\x03 \x01(\t\x12\x16\n\tunique_id\x18\x04 \x01(\tH\x00\x88\x01\x01\x12\x17\n\x0fhas_entity_name\x18\x05 \x01(\x08\x12!\n\x04info\x18\x06 \x01(\x0b\x32\x13.sandbox.EntityInfo\x12&\n\x07initial\x18\x07 \x01(\x0b\x32\x15.sandbox.InitialStateB\x0c\n\n_unique_id\")\n\x14RegisterEntityResult\x12\x11\n\tentity_id\x18\x01 \x01(\t\"-\n\x10UnregisterEntity\x12\x19\n\x11sandbox_entity_id\x18\x01 \x01(\t\"$\n\x16UnregisterEntityResult\x12\n\n\x02ok\x18\x01 \x01(\x08\"\x83\x01\n\x0cStateChanged\x12\x19\n\x11sandbox_entity_id\x18\x01 \x01(\t\x12\x12\n\x05state\x18\x02 \x01(\tH\x00\x88\x01\x01\x12\x12\n\nattributes\x18\x03 \x01(\x0c\x12\x17\n\ncontext_id\x18\x04 \x01(\tH\x01\x88\x01\x01\x42\x08\n\x06_stateB\r\n\x0b_context_id\"]\n\x0fRegisterService\x12\x0e\n\x06\x64omain\x18\x01 \x01(\t\x12\x0f\n\x07service\x18\x02 \x01(\t\x12\x19\n\x11supports_response\x18\x03 \x01(\t\x12\x0e\n\x06schema\x18\x04 \x01(\x0c\"6\n\x15RegisterServiceResult\x12\n\n\x02ok\x18\x01 \x01(\x08\x12\x11\n\tinstalled\x18\x02 \x01(\x08\"4\n\x11UnregisterService\x12\x0e\n\x06\x64omain\x18\x01 \x01(\t\x12\x0f\n\x07service\x18\x02 \x01(\t\"6\n\x17UnregisterServiceResult\x12\n\n\x02ok\x18\x01 \x01(\x08\x12\x0f\n\x07removed\x18\x02 \x01(\x08\"[\n\tFireEvent\x12\x12\n\nevent_type\x18\x01 \x01(\t\x12\x12\n\nevent_data\x18\x02 \x01(\x0c\x12\x17\n\ncontext_id\x18\x03 \x01(\tH\x00\x88\x01\x01\x42\r\n\x0b_context_id\"\x18\n\tStoreLoad\x12\x0b\n\x03key\x18\x01 \x01(\t\"-\n\x0fStoreLoadResult\x12\x11\n\x04\x64\x61ta\x18\x01 \x01(\x0cH\x00\x88\x01\x01\x42\x07\n\x05_data\"&\n\tStoreSave\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x0c\n\x04\x64\x61ta\x18\x02 \x01(\x0c\"\x1d\n\x0fStoreSaveResult\x12\n\n\x02ok\x18\x01 \x01(\x08\"\x1a\n\x0bStoreRemove\x12\x0b\n\x03key\x18\x01 \x01(\t\"\x1f\n\x11StoreRemoveResult\x12\n\n\x02ok\x18\x01 \x01(\x08\x62\x06proto3') _globals = globals() _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) @@ -80,51 +80,51 @@ if not _descriptor._USE_C_DESCRIPTORS: _globals['_READY']._serialized_start=2403 _globals['_READY']._serialized_end=2410 _globals['_FLOWINIT']._serialized_start=2412 - _globals['_FLOWINIT']._serialized_end=2484 - _globals['_FLOWSTEP']._serialized_start=2486 - _globals['_FLOWSTEP']._serialized_end=2553 - _globals['_FLOWABORT']._serialized_start=2555 - _globals['_FLOWABORT']._serialized_end=2583 - _globals['_FLOWABORTRESULT']._serialized_start=2585 - _globals['_FLOWABORTRESULT']._serialized_end=2602 - _globals['_FLOWRESULT']._serialized_start=2605 - _globals['_FLOWRESULT']._serialized_end=3267 - _globals['_ENTITYINFO']._serialized_start=3270 - _globals['_ENTITYINFO']._serialized_end=3664 - _globals['_ENTITYINFO_DESCRIPTION']._serialized_start=3391 - _globals['_ENTITYINFO_DESCRIPTION']._serialized_end=3632 - _globals['_INITIALSTATE']._serialized_start=3666 - _globals['_INITIALSTATE']._serialized_end=3752 - _globals['_ENTITYDESCRIPTION']._serialized_start=3755 - _globals['_ENTITYDESCRIPTION']._serialized_end=3973 - _globals['_REGISTERENTITYRESULT']._serialized_start=3975 - _globals['_REGISTERENTITYRESULT']._serialized_end=4016 - _globals['_UNREGISTERENTITY']._serialized_start=4018 - _globals['_UNREGISTERENTITY']._serialized_end=4063 - _globals['_UNREGISTERENTITYRESULT']._serialized_start=4065 - _globals['_UNREGISTERENTITYRESULT']._serialized_end=4101 - _globals['_STATECHANGED']._serialized_start=4104 - _globals['_STATECHANGED']._serialized_end=4235 - _globals['_REGISTERSERVICE']._serialized_start=4237 - _globals['_REGISTERSERVICE']._serialized_end=4330 - _globals['_REGISTERSERVICERESULT']._serialized_start=4332 - _globals['_REGISTERSERVICERESULT']._serialized_end=4386 - _globals['_UNREGISTERSERVICE']._serialized_start=4388 - _globals['_UNREGISTERSERVICE']._serialized_end=4440 - _globals['_UNREGISTERSERVICERESULT']._serialized_start=4442 - _globals['_UNREGISTERSERVICERESULT']._serialized_end=4496 - _globals['_FIREEVENT']._serialized_start=4498 - _globals['_FIREEVENT']._serialized_end=4589 - _globals['_STORELOAD']._serialized_start=4591 - _globals['_STORELOAD']._serialized_end=4615 - _globals['_STORELOADRESULT']._serialized_start=4617 - _globals['_STORELOADRESULT']._serialized_end=4662 - _globals['_STORESAVE']._serialized_start=4664 - _globals['_STORESAVE']._serialized_end=4702 - _globals['_STORESAVERESULT']._serialized_start=4704 - _globals['_STORESAVERESULT']._serialized_end=4733 - _globals['_STOREREMOVE']._serialized_start=4735 - _globals['_STOREREMOVE']._serialized_end=4761 - _globals['_STOREREMOVERESULT']._serialized_start=4763 - _globals['_STOREREMOVERESULT']._serialized_end=4794 + _globals['_FLOWINIT']._serialized_end=2535 + _globals['_FLOWSTEP']._serialized_start=2537 + _globals['_FLOWSTEP']._serialized_end=2604 + _globals['_FLOWABORT']._serialized_start=2606 + _globals['_FLOWABORT']._serialized_end=2634 + _globals['_FLOWABORTRESULT']._serialized_start=2636 + _globals['_FLOWABORTRESULT']._serialized_end=2653 + _globals['_FLOWRESULT']._serialized_start=2656 + _globals['_FLOWRESULT']._serialized_end=3318 + _globals['_ENTITYINFO']._serialized_start=3321 + _globals['_ENTITYINFO']._serialized_end=3715 + _globals['_ENTITYINFO_DESCRIPTION']._serialized_start=3442 + _globals['_ENTITYINFO_DESCRIPTION']._serialized_end=3683 + _globals['_INITIALSTATE']._serialized_start=3717 + _globals['_INITIALSTATE']._serialized_end=3803 + _globals['_ENTITYDESCRIPTION']._serialized_start=3806 + _globals['_ENTITYDESCRIPTION']._serialized_end=4024 + _globals['_REGISTERENTITYRESULT']._serialized_start=4026 + _globals['_REGISTERENTITYRESULT']._serialized_end=4067 + _globals['_UNREGISTERENTITY']._serialized_start=4069 + _globals['_UNREGISTERENTITY']._serialized_end=4114 + _globals['_UNREGISTERENTITYRESULT']._serialized_start=4116 + _globals['_UNREGISTERENTITYRESULT']._serialized_end=4152 + _globals['_STATECHANGED']._serialized_start=4155 + _globals['_STATECHANGED']._serialized_end=4286 + _globals['_REGISTERSERVICE']._serialized_start=4288 + _globals['_REGISTERSERVICE']._serialized_end=4381 + _globals['_REGISTERSERVICERESULT']._serialized_start=4383 + _globals['_REGISTERSERVICERESULT']._serialized_end=4437 + _globals['_UNREGISTERSERVICE']._serialized_start=4439 + _globals['_UNREGISTERSERVICE']._serialized_end=4491 + _globals['_UNREGISTERSERVICERESULT']._serialized_start=4493 + _globals['_UNREGISTERSERVICERESULT']._serialized_end=4547 + _globals['_FIREEVENT']._serialized_start=4549 + _globals['_FIREEVENT']._serialized_end=4640 + _globals['_STORELOAD']._serialized_start=4642 + _globals['_STORELOAD']._serialized_end=4666 + _globals['_STORELOADRESULT']._serialized_start=4668 + _globals['_STORELOADRESULT']._serialized_end=4713 + _globals['_STORESAVE']._serialized_start=4715 + _globals['_STORESAVE']._serialized_end=4753 + _globals['_STORESAVERESULT']._serialized_start=4755 + _globals['_STORESAVERESULT']._serialized_end=4784 + _globals['_STOREREMOVE']._serialized_start=4786 + _globals['_STOREREMOVE']._serialized_end=4812 + _globals['_STOREREMOVERESULT']._serialized_start=4814 + _globals['_STOREREMOVERESULT']._serialized_end=4845 # @@protoc_insertion_point(module_scope) diff --git a/homeassistant/components/sandbox/_proto/sandbox_pb2.pyi b/homeassistant/components/sandbox/_proto/sandbox_pb2.pyi index 2b378da080d0..7ced7dd004bc 100644 --- a/homeassistant/components/sandbox/_proto/sandbox_pb2.pyi +++ b/homeassistant/components/sandbox/_proto/sandbox_pb2.pyi @@ -269,14 +269,16 @@ class Ready(_message.Message): def __init__(self) -> None: ... class FlowInit(_message.Message): - __slots__ = ("handler", "context", "data") + __slots__ = ("handler", "context", "data", "entry") HANDLER_FIELD_NUMBER: _ClassVar[int] CONTEXT_FIELD_NUMBER: _ClassVar[int] DATA_FIELD_NUMBER: _ClassVar[int] + ENTRY_FIELD_NUMBER: _ClassVar[int] handler: str context: bytes data: bytes - def __init__(self, handler: _Optional[str] = ..., context: _Optional[bytes] = ..., data: _Optional[bytes] = ...) -> None: ... + entry: EntrySetup + def __init__(self, handler: _Optional[str] = ..., context: _Optional[bytes] = ..., data: _Optional[bytes] = ..., entry: _Optional[_Union[EntrySetup, _Mapping]] = ...) -> None: ... class FlowStep(_message.Message): __slots__ = ("flow_id", "user_input") diff --git a/homeassistant/components/sandbox/messages.py b/homeassistant/components/sandbox/messages.py index c90766002188..34ad9fa58561 100644 --- a/homeassistant/components/sandbox/messages.py +++ b/homeassistant/components/sandbox/messages.py @@ -328,6 +328,28 @@ def make_entity_description( return msg +def entry_to_setup_proto(entry: Any) -> pb.EntrySetup: + """Serialise the entry-identity fields of a ConfigEntry into EntrySetup. + + Shared by the entry_setup payload and the flow proxy's reauth/reconfigure + entry carry — only the fields the sandbox needs to rebuild the entry + (integration_source / core_config are filled separately by entry_setup). + """ + msg = pb.EntrySetup( + entry_id=entry.entry_id, + domain=entry.domain, + title=entry.title, + data=encode_json(dict(entry.data)), + options=encode_json(dict(entry.options)), + source=entry.source, + version=entry.version, + minor_version=entry.minor_version, + ) + if entry.unique_id is not None: + msg.unique_id = entry.unique_id + return msg + + def core_config_to_proto(config: Any) -> pb.CoreConfig: """Snapshot a hass ``Config`` into the wire ``CoreConfig`` message. diff --git a/homeassistant/components/sandbox/proxy_flow.py b/homeassistant/components/sandbox/proxy_flow.py index 237c4efc3960..ff7c389f23da 100644 --- a/homeassistant/components/sandbox/proxy_flow.py +++ b/homeassistant/components/sandbox/proxy_flow.py @@ -42,6 +42,7 @@ from .messages import ( decode_json, decode_json_dict, encode_json, + entry_to_setup_proto, ) from .schema_bridge import reconstruct_schema @@ -174,6 +175,15 @@ class SandboxFlowProxy(ConfigFlow): ) if user_input is not None: request.data = encode_json(_to_jsonable(user_input)) + # A reauth / reconfigure / reset flow operates on an existing + # entry that main owns. Carry a copy so the sandbox flow + # manager can resolve it — otherwise _get_reauth_entry() / + # _get_reconfigure_entry() raise UnknownEntry on the private + # hass. + if (entry_id := self.context.get("entry_id")) is not None and ( + entry := self.hass.config_entries.async_get_entry(entry_id) + ) is not None: + request.entry.CopyFrom(entry_to_setup_proto(entry)) result = await channel.call(MSG_FLOW_INIT, request) self._sandbox_flow_id = ( result.flow_id if result.HasField("flow_id") else None diff --git a/homeassistant/components/sandbox/router.py b/homeassistant/components/sandbox/router.py index 38cd030e2b47..356269e57903 100644 --- a/homeassistant/components/sandbox/router.py +++ b/homeassistant/components/sandbox/router.py @@ -33,7 +33,7 @@ from .messages import ( MSG_ENTRY_SETUP, MSG_ENTRY_UNLOAD, core_config_to_proto, - encode_json, + entry_to_setup_proto, ) from .proxy_flow import SandboxFlowProxy from .sources import SandboxSourceError, async_resolve_integration_source @@ -249,18 +249,7 @@ async def _entry_setup_payload( computes sun times / distances / unit conversions like main. May raise :class:`SandboxSourceError` if a custom integration has no source resolver. """ - msg = pb.EntrySetup( - entry_id=entry.entry_id, - domain=entry.domain, - title=entry.title, - data=encode_json(dict(entry.data)), - options=encode_json(dict(entry.options)), - source=entry.source, - version=entry.version, - minor_version=entry.minor_version, - ) - if entry.unique_id is not None: - msg.unique_id = entry.unique_id + msg = entry_to_setup_proto(entry) msg.integration_source.CopyFrom( await async_resolve_integration_source(hass, entry.domain) ) diff --git a/sandbox/hass_client/hass_client/_proto/sandbox_pb2.py b/sandbox/hass_client/hass_client/_proto/sandbox_pb2.py index 536b77d3ea1d..937871283362 100644 --- a/sandbox/hass_client/hass_client/_proto/sandbox_pb2.py +++ b/sandbox/hass_client/hass_client/_proto/sandbox_pb2.py @@ -24,7 +24,7 @@ _sym_db = _symbol_database.Default() -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\rsandbox.proto\x12\x07sandbox\"c\n\x05\x46rame\x12\n\n\x02id\x18\x01 \x01(\r\x12\x0c\n\x04type\x18\x02 \x01(\t\x12\x11\n\x07request\x18\x03 \x01(\x0cH\x00\x12%\n\x08response\x18\x04 \x01(\x0b\x32\x11.sandbox.ResponseH\x00\x42\x06\n\x04\x62ody\"E\n\x08Response\x12\n\n\x02ok\x18\x01 \x01(\x08\x12\x0e\n\x06result\x18\x02 \x01(\x0c\x12\x1d\n\x05\x65rror\x18\x03 \x01(\x0b\x32\x0e.sandbox.Error\"`\n\x05\x45rror\x12\x0f\n\x07message\x18\x01 \x01(\t\x12\x0c\n\x04type\x18\x02 \x01(\t\x12&\n\x07invalid\x18\x03 \x03(\x0b\x32\x15.sandbox.InvalidError\x12\x10\n\x08multiple\x18\x04 \x01(\x08\"-\n\x0cInvalidError\x12\x0f\n\x07message\x18\x01 \x01(\t\x12\x0c\n\x04path\x18\x02 \x03(\t\"(\n\nDevicePair\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t\"\xcc\x03\n\nDeviceInfo\x12(\n\x0bidentifiers\x18\x01 \x03(\x0b\x32\x13.sandbox.DevicePair\x12(\n\x0b\x63onnections\x18\x02 \x03(\x0b\x32\x13.sandbox.DevicePair\x12,\n\nvia_device\x18\x03 \x01(\x0b\x32\x13.sandbox.DevicePairH\x00\x88\x01\x01\x12\x12\n\nentry_type\x18\x04 \x01(\t\x12\x0c\n\x04name\x18\x05 \x01(\t\x12\x14\n\x0cmanufacturer\x18\x06 \x01(\t\x12\r\n\x05model\x18\x07 \x01(\t\x12\x10\n\x08model_id\x18\x08 \x01(\t\x12\x12\n\nsw_version\x18\t \x01(\t\x12\x12\n\nhw_version\x18\n \x01(\t\x12\x15\n\rserial_number\x18\x0b \x01(\t\x12\x16\n\x0esuggested_area\x18\x0c \x01(\t\x12\x19\n\x11\x63onfiguration_url\x18\r \x01(\t\x12\x14\n\x0c\x64\x65\x66\x61ult_name\x18\x0e \x01(\t\x12\x1c\n\x14\x64\x65\x66\x61ult_manufacturer\x18\x0f \x01(\t\x12\x15\n\rdefault_model\x18\x10 \x01(\t\x12\x17\n\x0ftranslation_key\x18\x11 \x01(\tB\r\n\x0b_via_device\"h\n\x11IntegrationSource\x12\x0c\n\x04kind\x18\x01 \x01(\t\x12\x0b\n\x03url\x18\x02 \x01(\t\x12\x0b\n\x03ref\x18\x03 \x01(\t\x12\x0b\n\x03tag\x18\x04 \x01(\t\x12\x0e\n\x06\x64omain\x18\x05 \x01(\t\x12\x0e\n\x06subdir\x18\x06 \x01(\t\"\xe4\x02\n\nCoreConfig\x12\x15\n\x08latitude\x18\x01 \x01(\x01H\x00\x88\x01\x01\x12\x16\n\tlongitude\x18\x02 \x01(\x01H\x01\x88\x01\x01\x12\x16\n\televation\x18\x03 \x01(\x01H\x02\x88\x01\x01\x12\x16\n\ttime_zone\x18\x04 \x01(\tH\x03\x88\x01\x01\x12\x18\n\x0bunit_system\x18\x05 \x01(\tH\x04\x88\x01\x01\x12\x15\n\x08language\x18\x06 \x01(\tH\x05\x88\x01\x01\x12\x14\n\x07\x63ountry\x18\x07 \x01(\tH\x06\x88\x01\x01\x12\x15\n\x08\x63urrency\x18\x08 \x01(\tH\x07\x88\x01\x01\x12\x1a\n\rlocation_name\x18\t \x01(\tH\x08\x88\x01\x01\x42\x0b\n\t_latitudeB\x0c\n\n_longitudeB\x0c\n\n_elevationB\x0c\n\n_time_zoneB\x0e\n\x0c_unit_systemB\x0b\n\t_languageB\n\n\x08_countryB\x0b\n\t_currencyB\x10\n\x0e_location_name\"\x9c\x02\n\nEntrySetup\x12\x10\n\x08\x65ntry_id\x18\x01 \x01(\t\x12\x0e\n\x06\x64omain\x18\x02 \x01(\t\x12\r\n\x05title\x18\x03 \x01(\t\x12\x0c\n\x04\x64\x61ta\x18\x04 \x01(\x0c\x12\x0f\n\x07options\x18\x05 \x01(\x0c\x12\x0e\n\x06source\x18\x06 \x01(\t\x12\x16\n\tunique_id\x18\x07 \x01(\tH\x00\x88\x01\x01\x12\x0f\n\x07version\x18\x08 \x01(\x05\x12\x15\n\rminor_version\x18\t \x01(\x05\x12\x36\n\x12integration_source\x18\n \x01(\x0b\x32\x1a.sandbox.IntegrationSource\x12(\n\x0b\x63ore_config\x18\x0b \x01(\x0b\x32\x13.sandbox.CoreConfigB\x0c\n\n_unique_id\">\n\x10\x45ntrySetupResult\x12\n\n\x02ok\x18\x01 \x01(\x08\x12\x13\n\x06reason\x18\x02 \x01(\tH\x00\x88\x01\x01\x42\t\n\x07_reason\"\x1f\n\x0b\x45ntryUnload\x12\x10\n\x08\x65ntry_id\x18\x01 \x01(\t\"\x1f\n\x11\x45ntryUnloadResult\x12\n\n\x02ok\x18\x01 \x01(\x08\"\x95\x01\n\x0b\x43\x61llService\x12\x0e\n\x06\x64omain\x18\x01 \x01(\t\x12\x0f\n\x07service\x18\x02 \x01(\t\x12\x0e\n\x06target\x18\x03 \x01(\x0c\x12\x14\n\x0cservice_data\x18\x04 \x01(\x0c\x12\x17\n\ncontext_id\x18\x05 \x01(\tH\x00\x88\x01\x01\x12\x17\n\x0freturn_response\x18\x06 \x01(\x08\x42\r\n\x0b_context_id\"\x1f\n\x0fServiceResponse\x12\x0c\n\x04\x64\x61ta\x18\x01 \x01(\x0c\"Q\n\x11\x43\x61llServiceResult\x12/\n\x08response\x18\x01 \x01(\x0b\x32\x18.sandbox.ServiceResponseH\x00\x88\x01\x01\x42\x0b\n\t_response\"n\n\x0b\x45ntityQuery\x12\x19\n\x11sandbox_entity_id\x18\x01 \x01(\t\x12\x0e\n\x06method\x18\x02 \x01(\t\x12\x0c\n\x04\x61rgs\x18\x03 \x01(\x0c\x12\x17\n\ncontext_id\x18\x04 \x01(\tH\x00\x88\x01\x01\x42\r\n\x0b_context_id\"#\n\x11\x45ntityQueryResult\x12\x0e\n\x06result\x18\x01 \x01(\x0c\"4\n\x0fGetTranslations\x12\x10\n\x08language\x18\x01 \x01(\t\x12\x0f\n\x07\x64omains\x18\x02 \x03(\t\":\n\x15GetTranslationsResult\x12\x10\n\x08language\x18\x01 \x01(\t\x12\x0f\n\x07strings\x18\x02 \x01(\x0c\"\n\n\x08Shutdown\"\\\n\x0eShutdownResult\x12\n\n\x02ok\x18\x01 \x01(\x08\x12\x10\n\x08unloaded\x18\x02 \x01(\x05\x12\x1a\n\rrestore_state\x18\x03 \x01(\x0cH\x00\x88\x01\x01\x42\x10\n\x0e_restore_state\"\x06\n\x04Ping\"\x1a\n\nPingResult\x12\x0c\n\x04pong\x18\x01 \x01(\t\"\x07\n\x05Ready\"H\n\x08\x46lowInit\x12\x0f\n\x07handler\x18\x01 \x01(\t\x12\x0f\n\x07\x63ontext\x18\x02 \x01(\x0c\x12\x11\n\x04\x64\x61ta\x18\x03 \x01(\x0cH\x00\x88\x01\x01\x42\x07\n\x05_data\"C\n\x08\x46lowStep\x12\x0f\n\x07\x66low_id\x18\x01 \x01(\t\x12\x17\n\nuser_input\x18\x02 \x01(\x0cH\x00\x88\x01\x01\x42\r\n\x0b_user_input\"\x1c\n\tFlowAbort\x12\x0f\n\x07\x66low_id\x18\x01 \x01(\t\"\x11\n\x0f\x46lowAbortResult\"\x96\x05\n\nFlowResult\x12\x0c\n\x04type\x18\x01 \x01(\t\x12\x14\n\x07\x66low_id\x18\x02 \x01(\tH\x00\x88\x01\x01\x12\x14\n\x07handler\x18\x03 \x01(\tH\x01\x88\x01\x01\x12\x14\n\x07step_id\x18\x04 \x01(\tH\x02\x88\x01\x01\x12\x13\n\x06reason\x18\x05 \x01(\tH\x03\x88\x01\x01\x12\x12\n\x05title\x18\x06 \x01(\tH\x04\x88\x01\x01\x12\x18\n\x0b\x64\x65scription\x18\x07 \x01(\tH\x05\x88\x01\x01\x12\x16\n\tlast_step\x18\x08 \x01(\x08H\x06\x88\x01\x01\x12\x14\n\x07preview\x18\t \x01(\tH\x07\x88\x01\x01\x12\x14\n\x07version\x18\n \x01(\x05H\x08\x88\x01\x01\x12\x1a\n\rminor_version\x18\x0b \x01(\x05H\t\x88\x01\x01\x12\x0c\n\x04\x64\x61ta\x18\x0c \x01(\x0c\x12\x14\n\x07options\x18\r \x01(\x0cH\n\x88\x01\x01\x12\x13\n\x06\x65rrors\x18\x0e \x01(\x0cH\x0b\x88\x01\x01\x12%\n\x18\x64\x65scription_placeholders\x18\x0f \x01(\x0cH\x0c\x88\x01\x01\x12\x14\n\x07\x63ontext\x18\x10 \x01(\x0cH\r\x88\x01\x01\x12\x13\n\x0b\x64\x61ta_schema\x18\x11 \x01(\x0c\x12\x17\n\x0fhas_data_schema\x18\x12 \x01(\x08\x12\x14\n\x0cmenu_options\x18\x13 \x01(\x0c\x12\x11\n\x04sort\x18\x14 \x01(\x08H\x0e\x88\x01\x01\x42\n\n\x08_flow_idB\n\n\x08_handlerB\n\n\x08_step_idB\t\n\x07_reasonB\x08\n\x06_titleB\x0e\n\x0c_descriptionB\x0c\n\n_last_stepB\n\n\x08_previewB\n\n\x08_versionB\x10\n\x0e_minor_versionB\n\n\x08_optionsB\t\n\x07_errorsB\x1b\n\x19_description_placeholdersB\n\n\x08_contextB\x07\n\x05_sort\"\x8a\x03\n\nEntityInfo\x12\x39\n\x0b\x64\x65scription\x18\x01 \x01(\x0b\x32\x1f.sandbox.EntityInfo.DescriptionH\x00\x88\x01\x01\x12-\n\x0b\x64\x65vice_info\x18\x02 \x01(\x0b\x32\x13.sandbox.DeviceInfoH\x01\x88\x01\x01\x1a\xf1\x01\n\x0b\x44\x65scription\x12\x11\n\x04name\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x11\n\x04icon\x18\x02 \x01(\tH\x01\x88\x01\x01\x12\x1c\n\x0f\x65ntity_category\x18\x03 \x01(\tH\x02\x88\x01\x01\x12\x19\n\x0c\x64\x65vice_class\x18\x04 \x01(\tH\x03\x88\x01\x01\x12\x1a\n\x12supported_features\x18\x05 \x01(\x05\x12\x1c\n\x0ftranslation_key\x18\x06 \x01(\tH\x04\x88\x01\x01\x42\x07\n\x05_nameB\x07\n\x05_iconB\x12\n\x10_entity_categoryB\x0f\n\r_device_classB\x12\n\x10_translation_keyB\x0e\n\x0c_descriptionB\x0e\n\x0c_device_info\"V\n\x0cInitialState\x12\x12\n\x05state\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x14\n\x0c\x63\x61pabilities\x18\x02 \x01(\x0c\x12\x12\n\nattributes\x18\x03 \x01(\x0c\x42\x08\n\x06_state\"\xda\x01\n\x11\x45ntityDescription\x12\x10\n\x08\x65ntry_id\x18\x01 \x01(\t\x12\x0e\n\x06\x64omain\x18\x02 \x01(\t\x12\x19\n\x11sandbox_entity_id\x18\x03 \x01(\t\x12\x16\n\tunique_id\x18\x04 \x01(\tH\x00\x88\x01\x01\x12\x17\n\x0fhas_entity_name\x18\x05 \x01(\x08\x12!\n\x04info\x18\x06 \x01(\x0b\x32\x13.sandbox.EntityInfo\x12&\n\x07initial\x18\x07 \x01(\x0b\x32\x15.sandbox.InitialStateB\x0c\n\n_unique_id\")\n\x14RegisterEntityResult\x12\x11\n\tentity_id\x18\x01 \x01(\t\"-\n\x10UnregisterEntity\x12\x19\n\x11sandbox_entity_id\x18\x01 \x01(\t\"$\n\x16UnregisterEntityResult\x12\n\n\x02ok\x18\x01 \x01(\x08\"\x83\x01\n\x0cStateChanged\x12\x19\n\x11sandbox_entity_id\x18\x01 \x01(\t\x12\x12\n\x05state\x18\x02 \x01(\tH\x00\x88\x01\x01\x12\x12\n\nattributes\x18\x03 \x01(\x0c\x12\x17\n\ncontext_id\x18\x04 \x01(\tH\x01\x88\x01\x01\x42\x08\n\x06_stateB\r\n\x0b_context_id\"]\n\x0fRegisterService\x12\x0e\n\x06\x64omain\x18\x01 \x01(\t\x12\x0f\n\x07service\x18\x02 \x01(\t\x12\x19\n\x11supports_response\x18\x03 \x01(\t\x12\x0e\n\x06schema\x18\x04 \x01(\x0c\"6\n\x15RegisterServiceResult\x12\n\n\x02ok\x18\x01 \x01(\x08\x12\x11\n\tinstalled\x18\x02 \x01(\x08\"4\n\x11UnregisterService\x12\x0e\n\x06\x64omain\x18\x01 \x01(\t\x12\x0f\n\x07service\x18\x02 \x01(\t\"6\n\x17UnregisterServiceResult\x12\n\n\x02ok\x18\x01 \x01(\x08\x12\x0f\n\x07removed\x18\x02 \x01(\x08\"[\n\tFireEvent\x12\x12\n\nevent_type\x18\x01 \x01(\t\x12\x12\n\nevent_data\x18\x02 \x01(\x0c\x12\x17\n\ncontext_id\x18\x03 \x01(\tH\x00\x88\x01\x01\x42\r\n\x0b_context_id\"\x18\n\tStoreLoad\x12\x0b\n\x03key\x18\x01 \x01(\t\"-\n\x0fStoreLoadResult\x12\x11\n\x04\x64\x61ta\x18\x01 \x01(\x0cH\x00\x88\x01\x01\x42\x07\n\x05_data\"&\n\tStoreSave\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x0c\n\x04\x64\x61ta\x18\x02 \x01(\x0c\"\x1d\n\x0fStoreSaveResult\x12\n\n\x02ok\x18\x01 \x01(\x08\"\x1a\n\x0bStoreRemove\x12\x0b\n\x03key\x18\x01 \x01(\t\"\x1f\n\x11StoreRemoveResult\x12\n\n\x02ok\x18\x01 \x01(\x08\x62\x06proto3') +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\rsandbox.proto\x12\x07sandbox\"c\n\x05\x46rame\x12\n\n\x02id\x18\x01 \x01(\r\x12\x0c\n\x04type\x18\x02 \x01(\t\x12\x11\n\x07request\x18\x03 \x01(\x0cH\x00\x12%\n\x08response\x18\x04 \x01(\x0b\x32\x11.sandbox.ResponseH\x00\x42\x06\n\x04\x62ody\"E\n\x08Response\x12\n\n\x02ok\x18\x01 \x01(\x08\x12\x0e\n\x06result\x18\x02 \x01(\x0c\x12\x1d\n\x05\x65rror\x18\x03 \x01(\x0b\x32\x0e.sandbox.Error\"`\n\x05\x45rror\x12\x0f\n\x07message\x18\x01 \x01(\t\x12\x0c\n\x04type\x18\x02 \x01(\t\x12&\n\x07invalid\x18\x03 \x03(\x0b\x32\x15.sandbox.InvalidError\x12\x10\n\x08multiple\x18\x04 \x01(\x08\"-\n\x0cInvalidError\x12\x0f\n\x07message\x18\x01 \x01(\t\x12\x0c\n\x04path\x18\x02 \x03(\t\"(\n\nDevicePair\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t\"\xcc\x03\n\nDeviceInfo\x12(\n\x0bidentifiers\x18\x01 \x03(\x0b\x32\x13.sandbox.DevicePair\x12(\n\x0b\x63onnections\x18\x02 \x03(\x0b\x32\x13.sandbox.DevicePair\x12,\n\nvia_device\x18\x03 \x01(\x0b\x32\x13.sandbox.DevicePairH\x00\x88\x01\x01\x12\x12\n\nentry_type\x18\x04 \x01(\t\x12\x0c\n\x04name\x18\x05 \x01(\t\x12\x14\n\x0cmanufacturer\x18\x06 \x01(\t\x12\r\n\x05model\x18\x07 \x01(\t\x12\x10\n\x08model_id\x18\x08 \x01(\t\x12\x12\n\nsw_version\x18\t \x01(\t\x12\x12\n\nhw_version\x18\n \x01(\t\x12\x15\n\rserial_number\x18\x0b \x01(\t\x12\x16\n\x0esuggested_area\x18\x0c \x01(\t\x12\x19\n\x11\x63onfiguration_url\x18\r \x01(\t\x12\x14\n\x0c\x64\x65\x66\x61ult_name\x18\x0e \x01(\t\x12\x1c\n\x14\x64\x65\x66\x61ult_manufacturer\x18\x0f \x01(\t\x12\x15\n\rdefault_model\x18\x10 \x01(\t\x12\x17\n\x0ftranslation_key\x18\x11 \x01(\tB\r\n\x0b_via_device\"h\n\x11IntegrationSource\x12\x0c\n\x04kind\x18\x01 \x01(\t\x12\x0b\n\x03url\x18\x02 \x01(\t\x12\x0b\n\x03ref\x18\x03 \x01(\t\x12\x0b\n\x03tag\x18\x04 \x01(\t\x12\x0e\n\x06\x64omain\x18\x05 \x01(\t\x12\x0e\n\x06subdir\x18\x06 \x01(\t\"\xe4\x02\n\nCoreConfig\x12\x15\n\x08latitude\x18\x01 \x01(\x01H\x00\x88\x01\x01\x12\x16\n\tlongitude\x18\x02 \x01(\x01H\x01\x88\x01\x01\x12\x16\n\televation\x18\x03 \x01(\x01H\x02\x88\x01\x01\x12\x16\n\ttime_zone\x18\x04 \x01(\tH\x03\x88\x01\x01\x12\x18\n\x0bunit_system\x18\x05 \x01(\tH\x04\x88\x01\x01\x12\x15\n\x08language\x18\x06 \x01(\tH\x05\x88\x01\x01\x12\x14\n\x07\x63ountry\x18\x07 \x01(\tH\x06\x88\x01\x01\x12\x15\n\x08\x63urrency\x18\x08 \x01(\tH\x07\x88\x01\x01\x12\x1a\n\rlocation_name\x18\t \x01(\tH\x08\x88\x01\x01\x42\x0b\n\t_latitudeB\x0c\n\n_longitudeB\x0c\n\n_elevationB\x0c\n\n_time_zoneB\x0e\n\x0c_unit_systemB\x0b\n\t_languageB\n\n\x08_countryB\x0b\n\t_currencyB\x10\n\x0e_location_name\"\x9c\x02\n\nEntrySetup\x12\x10\n\x08\x65ntry_id\x18\x01 \x01(\t\x12\x0e\n\x06\x64omain\x18\x02 \x01(\t\x12\r\n\x05title\x18\x03 \x01(\t\x12\x0c\n\x04\x64\x61ta\x18\x04 \x01(\x0c\x12\x0f\n\x07options\x18\x05 \x01(\x0c\x12\x0e\n\x06source\x18\x06 \x01(\t\x12\x16\n\tunique_id\x18\x07 \x01(\tH\x00\x88\x01\x01\x12\x0f\n\x07version\x18\x08 \x01(\x05\x12\x15\n\rminor_version\x18\t \x01(\x05\x12\x36\n\x12integration_source\x18\n \x01(\x0b\x32\x1a.sandbox.IntegrationSource\x12(\n\x0b\x63ore_config\x18\x0b \x01(\x0b\x32\x13.sandbox.CoreConfigB\x0c\n\n_unique_id\">\n\x10\x45ntrySetupResult\x12\n\n\x02ok\x18\x01 \x01(\x08\x12\x13\n\x06reason\x18\x02 \x01(\tH\x00\x88\x01\x01\x42\t\n\x07_reason\"\x1f\n\x0b\x45ntryUnload\x12\x10\n\x08\x65ntry_id\x18\x01 \x01(\t\"\x1f\n\x11\x45ntryUnloadResult\x12\n\n\x02ok\x18\x01 \x01(\x08\"\x95\x01\n\x0b\x43\x61llService\x12\x0e\n\x06\x64omain\x18\x01 \x01(\t\x12\x0f\n\x07service\x18\x02 \x01(\t\x12\x0e\n\x06target\x18\x03 \x01(\x0c\x12\x14\n\x0cservice_data\x18\x04 \x01(\x0c\x12\x17\n\ncontext_id\x18\x05 \x01(\tH\x00\x88\x01\x01\x12\x17\n\x0freturn_response\x18\x06 \x01(\x08\x42\r\n\x0b_context_id\"\x1f\n\x0fServiceResponse\x12\x0c\n\x04\x64\x61ta\x18\x01 \x01(\x0c\"Q\n\x11\x43\x61llServiceResult\x12/\n\x08response\x18\x01 \x01(\x0b\x32\x18.sandbox.ServiceResponseH\x00\x88\x01\x01\x42\x0b\n\t_response\"n\n\x0b\x45ntityQuery\x12\x19\n\x11sandbox_entity_id\x18\x01 \x01(\t\x12\x0e\n\x06method\x18\x02 \x01(\t\x12\x0c\n\x04\x61rgs\x18\x03 \x01(\x0c\x12\x17\n\ncontext_id\x18\x04 \x01(\tH\x00\x88\x01\x01\x42\r\n\x0b_context_id\"#\n\x11\x45ntityQueryResult\x12\x0e\n\x06result\x18\x01 \x01(\x0c\"4\n\x0fGetTranslations\x12\x10\n\x08language\x18\x01 \x01(\t\x12\x0f\n\x07\x64omains\x18\x02 \x03(\t\":\n\x15GetTranslationsResult\x12\x10\n\x08language\x18\x01 \x01(\t\x12\x0f\n\x07strings\x18\x02 \x01(\x0c\"\n\n\x08Shutdown\"\\\n\x0eShutdownResult\x12\n\n\x02ok\x18\x01 \x01(\x08\x12\x10\n\x08unloaded\x18\x02 \x01(\x05\x12\x1a\n\rrestore_state\x18\x03 \x01(\x0cH\x00\x88\x01\x01\x42\x10\n\x0e_restore_state\"\x06\n\x04Ping\"\x1a\n\nPingResult\x12\x0c\n\x04pong\x18\x01 \x01(\t\"\x07\n\x05Ready\"{\n\x08\x46lowInit\x12\x0f\n\x07handler\x18\x01 \x01(\t\x12\x0f\n\x07\x63ontext\x18\x02 \x01(\x0c\x12\x11\n\x04\x64\x61ta\x18\x03 \x01(\x0cH\x00\x88\x01\x01\x12\'\n\x05\x65ntry\x18\x04 \x01(\x0b\x32\x13.sandbox.EntrySetupH\x01\x88\x01\x01\x42\x07\n\x05_dataB\x08\n\x06_entry\"C\n\x08\x46lowStep\x12\x0f\n\x07\x66low_id\x18\x01 \x01(\t\x12\x17\n\nuser_input\x18\x02 \x01(\x0cH\x00\x88\x01\x01\x42\r\n\x0b_user_input\"\x1c\n\tFlowAbort\x12\x0f\n\x07\x66low_id\x18\x01 \x01(\t\"\x11\n\x0f\x46lowAbortResult\"\x96\x05\n\nFlowResult\x12\x0c\n\x04type\x18\x01 \x01(\t\x12\x14\n\x07\x66low_id\x18\x02 \x01(\tH\x00\x88\x01\x01\x12\x14\n\x07handler\x18\x03 \x01(\tH\x01\x88\x01\x01\x12\x14\n\x07step_id\x18\x04 \x01(\tH\x02\x88\x01\x01\x12\x13\n\x06reason\x18\x05 \x01(\tH\x03\x88\x01\x01\x12\x12\n\x05title\x18\x06 \x01(\tH\x04\x88\x01\x01\x12\x18\n\x0b\x64\x65scription\x18\x07 \x01(\tH\x05\x88\x01\x01\x12\x16\n\tlast_step\x18\x08 \x01(\x08H\x06\x88\x01\x01\x12\x14\n\x07preview\x18\t \x01(\tH\x07\x88\x01\x01\x12\x14\n\x07version\x18\n \x01(\x05H\x08\x88\x01\x01\x12\x1a\n\rminor_version\x18\x0b \x01(\x05H\t\x88\x01\x01\x12\x0c\n\x04\x64\x61ta\x18\x0c \x01(\x0c\x12\x14\n\x07options\x18\r \x01(\x0cH\n\x88\x01\x01\x12\x13\n\x06\x65rrors\x18\x0e \x01(\x0cH\x0b\x88\x01\x01\x12%\n\x18\x64\x65scription_placeholders\x18\x0f \x01(\x0cH\x0c\x88\x01\x01\x12\x14\n\x07\x63ontext\x18\x10 \x01(\x0cH\r\x88\x01\x01\x12\x13\n\x0b\x64\x61ta_schema\x18\x11 \x01(\x0c\x12\x17\n\x0fhas_data_schema\x18\x12 \x01(\x08\x12\x14\n\x0cmenu_options\x18\x13 \x01(\x0c\x12\x11\n\x04sort\x18\x14 \x01(\x08H\x0e\x88\x01\x01\x42\n\n\x08_flow_idB\n\n\x08_handlerB\n\n\x08_step_idB\t\n\x07_reasonB\x08\n\x06_titleB\x0e\n\x0c_descriptionB\x0c\n\n_last_stepB\n\n\x08_previewB\n\n\x08_versionB\x10\n\x0e_minor_versionB\n\n\x08_optionsB\t\n\x07_errorsB\x1b\n\x19_description_placeholdersB\n\n\x08_contextB\x07\n\x05_sort\"\x8a\x03\n\nEntityInfo\x12\x39\n\x0b\x64\x65scription\x18\x01 \x01(\x0b\x32\x1f.sandbox.EntityInfo.DescriptionH\x00\x88\x01\x01\x12-\n\x0b\x64\x65vice_info\x18\x02 \x01(\x0b\x32\x13.sandbox.DeviceInfoH\x01\x88\x01\x01\x1a\xf1\x01\n\x0b\x44\x65scription\x12\x11\n\x04name\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x11\n\x04icon\x18\x02 \x01(\tH\x01\x88\x01\x01\x12\x1c\n\x0f\x65ntity_category\x18\x03 \x01(\tH\x02\x88\x01\x01\x12\x19\n\x0c\x64\x65vice_class\x18\x04 \x01(\tH\x03\x88\x01\x01\x12\x1a\n\x12supported_features\x18\x05 \x01(\x05\x12\x1c\n\x0ftranslation_key\x18\x06 \x01(\tH\x04\x88\x01\x01\x42\x07\n\x05_nameB\x07\n\x05_iconB\x12\n\x10_entity_categoryB\x0f\n\r_device_classB\x12\n\x10_translation_keyB\x0e\n\x0c_descriptionB\x0e\n\x0c_device_info\"V\n\x0cInitialState\x12\x12\n\x05state\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x14\n\x0c\x63\x61pabilities\x18\x02 \x01(\x0c\x12\x12\n\nattributes\x18\x03 \x01(\x0c\x42\x08\n\x06_state\"\xda\x01\n\x11\x45ntityDescription\x12\x10\n\x08\x65ntry_id\x18\x01 \x01(\t\x12\x0e\n\x06\x64omain\x18\x02 \x01(\t\x12\x19\n\x11sandbox_entity_id\x18\x03 \x01(\t\x12\x16\n\tunique_id\x18\x04 \x01(\tH\x00\x88\x01\x01\x12\x17\n\x0fhas_entity_name\x18\x05 \x01(\x08\x12!\n\x04info\x18\x06 \x01(\x0b\x32\x13.sandbox.EntityInfo\x12&\n\x07initial\x18\x07 \x01(\x0b\x32\x15.sandbox.InitialStateB\x0c\n\n_unique_id\")\n\x14RegisterEntityResult\x12\x11\n\tentity_id\x18\x01 \x01(\t\"-\n\x10UnregisterEntity\x12\x19\n\x11sandbox_entity_id\x18\x01 \x01(\t\"$\n\x16UnregisterEntityResult\x12\n\n\x02ok\x18\x01 \x01(\x08\"\x83\x01\n\x0cStateChanged\x12\x19\n\x11sandbox_entity_id\x18\x01 \x01(\t\x12\x12\n\x05state\x18\x02 \x01(\tH\x00\x88\x01\x01\x12\x12\n\nattributes\x18\x03 \x01(\x0c\x12\x17\n\ncontext_id\x18\x04 \x01(\tH\x01\x88\x01\x01\x42\x08\n\x06_stateB\r\n\x0b_context_id\"]\n\x0fRegisterService\x12\x0e\n\x06\x64omain\x18\x01 \x01(\t\x12\x0f\n\x07service\x18\x02 \x01(\t\x12\x19\n\x11supports_response\x18\x03 \x01(\t\x12\x0e\n\x06schema\x18\x04 \x01(\x0c\"6\n\x15RegisterServiceResult\x12\n\n\x02ok\x18\x01 \x01(\x08\x12\x11\n\tinstalled\x18\x02 \x01(\x08\"4\n\x11UnregisterService\x12\x0e\n\x06\x64omain\x18\x01 \x01(\t\x12\x0f\n\x07service\x18\x02 \x01(\t\"6\n\x17UnregisterServiceResult\x12\n\n\x02ok\x18\x01 \x01(\x08\x12\x0f\n\x07removed\x18\x02 \x01(\x08\"[\n\tFireEvent\x12\x12\n\nevent_type\x18\x01 \x01(\t\x12\x12\n\nevent_data\x18\x02 \x01(\x0c\x12\x17\n\ncontext_id\x18\x03 \x01(\tH\x00\x88\x01\x01\x42\r\n\x0b_context_id\"\x18\n\tStoreLoad\x12\x0b\n\x03key\x18\x01 \x01(\t\"-\n\x0fStoreLoadResult\x12\x11\n\x04\x64\x61ta\x18\x01 \x01(\x0cH\x00\x88\x01\x01\x42\x07\n\x05_data\"&\n\tStoreSave\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x0c\n\x04\x64\x61ta\x18\x02 \x01(\x0c\"\x1d\n\x0fStoreSaveResult\x12\n\n\x02ok\x18\x01 \x01(\x08\"\x1a\n\x0bStoreRemove\x12\x0b\n\x03key\x18\x01 \x01(\t\"\x1f\n\x11StoreRemoveResult\x12\n\n\x02ok\x18\x01 \x01(\x08\x62\x06proto3') _globals = globals() _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) @@ -80,51 +80,51 @@ if not _descriptor._USE_C_DESCRIPTORS: _globals['_READY']._serialized_start=2403 _globals['_READY']._serialized_end=2410 _globals['_FLOWINIT']._serialized_start=2412 - _globals['_FLOWINIT']._serialized_end=2484 - _globals['_FLOWSTEP']._serialized_start=2486 - _globals['_FLOWSTEP']._serialized_end=2553 - _globals['_FLOWABORT']._serialized_start=2555 - _globals['_FLOWABORT']._serialized_end=2583 - _globals['_FLOWABORTRESULT']._serialized_start=2585 - _globals['_FLOWABORTRESULT']._serialized_end=2602 - _globals['_FLOWRESULT']._serialized_start=2605 - _globals['_FLOWRESULT']._serialized_end=3267 - _globals['_ENTITYINFO']._serialized_start=3270 - _globals['_ENTITYINFO']._serialized_end=3664 - _globals['_ENTITYINFO_DESCRIPTION']._serialized_start=3391 - _globals['_ENTITYINFO_DESCRIPTION']._serialized_end=3632 - _globals['_INITIALSTATE']._serialized_start=3666 - _globals['_INITIALSTATE']._serialized_end=3752 - _globals['_ENTITYDESCRIPTION']._serialized_start=3755 - _globals['_ENTITYDESCRIPTION']._serialized_end=3973 - _globals['_REGISTERENTITYRESULT']._serialized_start=3975 - _globals['_REGISTERENTITYRESULT']._serialized_end=4016 - _globals['_UNREGISTERENTITY']._serialized_start=4018 - _globals['_UNREGISTERENTITY']._serialized_end=4063 - _globals['_UNREGISTERENTITYRESULT']._serialized_start=4065 - _globals['_UNREGISTERENTITYRESULT']._serialized_end=4101 - _globals['_STATECHANGED']._serialized_start=4104 - _globals['_STATECHANGED']._serialized_end=4235 - _globals['_REGISTERSERVICE']._serialized_start=4237 - _globals['_REGISTERSERVICE']._serialized_end=4330 - _globals['_REGISTERSERVICERESULT']._serialized_start=4332 - _globals['_REGISTERSERVICERESULT']._serialized_end=4386 - _globals['_UNREGISTERSERVICE']._serialized_start=4388 - _globals['_UNREGISTERSERVICE']._serialized_end=4440 - _globals['_UNREGISTERSERVICERESULT']._serialized_start=4442 - _globals['_UNREGISTERSERVICERESULT']._serialized_end=4496 - _globals['_FIREEVENT']._serialized_start=4498 - _globals['_FIREEVENT']._serialized_end=4589 - _globals['_STORELOAD']._serialized_start=4591 - _globals['_STORELOAD']._serialized_end=4615 - _globals['_STORELOADRESULT']._serialized_start=4617 - _globals['_STORELOADRESULT']._serialized_end=4662 - _globals['_STORESAVE']._serialized_start=4664 - _globals['_STORESAVE']._serialized_end=4702 - _globals['_STORESAVERESULT']._serialized_start=4704 - _globals['_STORESAVERESULT']._serialized_end=4733 - _globals['_STOREREMOVE']._serialized_start=4735 - _globals['_STOREREMOVE']._serialized_end=4761 - _globals['_STOREREMOVERESULT']._serialized_start=4763 - _globals['_STOREREMOVERESULT']._serialized_end=4794 + _globals['_FLOWINIT']._serialized_end=2535 + _globals['_FLOWSTEP']._serialized_start=2537 + _globals['_FLOWSTEP']._serialized_end=2604 + _globals['_FLOWABORT']._serialized_start=2606 + _globals['_FLOWABORT']._serialized_end=2634 + _globals['_FLOWABORTRESULT']._serialized_start=2636 + _globals['_FLOWABORTRESULT']._serialized_end=2653 + _globals['_FLOWRESULT']._serialized_start=2656 + _globals['_FLOWRESULT']._serialized_end=3318 + _globals['_ENTITYINFO']._serialized_start=3321 + _globals['_ENTITYINFO']._serialized_end=3715 + _globals['_ENTITYINFO_DESCRIPTION']._serialized_start=3442 + _globals['_ENTITYINFO_DESCRIPTION']._serialized_end=3683 + _globals['_INITIALSTATE']._serialized_start=3717 + _globals['_INITIALSTATE']._serialized_end=3803 + _globals['_ENTITYDESCRIPTION']._serialized_start=3806 + _globals['_ENTITYDESCRIPTION']._serialized_end=4024 + _globals['_REGISTERENTITYRESULT']._serialized_start=4026 + _globals['_REGISTERENTITYRESULT']._serialized_end=4067 + _globals['_UNREGISTERENTITY']._serialized_start=4069 + _globals['_UNREGISTERENTITY']._serialized_end=4114 + _globals['_UNREGISTERENTITYRESULT']._serialized_start=4116 + _globals['_UNREGISTERENTITYRESULT']._serialized_end=4152 + _globals['_STATECHANGED']._serialized_start=4155 + _globals['_STATECHANGED']._serialized_end=4286 + _globals['_REGISTERSERVICE']._serialized_start=4288 + _globals['_REGISTERSERVICE']._serialized_end=4381 + _globals['_REGISTERSERVICERESULT']._serialized_start=4383 + _globals['_REGISTERSERVICERESULT']._serialized_end=4437 + _globals['_UNREGISTERSERVICE']._serialized_start=4439 + _globals['_UNREGISTERSERVICE']._serialized_end=4491 + _globals['_UNREGISTERSERVICERESULT']._serialized_start=4493 + _globals['_UNREGISTERSERVICERESULT']._serialized_end=4547 + _globals['_FIREEVENT']._serialized_start=4549 + _globals['_FIREEVENT']._serialized_end=4640 + _globals['_STORELOAD']._serialized_start=4642 + _globals['_STORELOAD']._serialized_end=4666 + _globals['_STORELOADRESULT']._serialized_start=4668 + _globals['_STORELOADRESULT']._serialized_end=4713 + _globals['_STORESAVE']._serialized_start=4715 + _globals['_STORESAVE']._serialized_end=4753 + _globals['_STORESAVERESULT']._serialized_start=4755 + _globals['_STORESAVERESULT']._serialized_end=4784 + _globals['_STOREREMOVE']._serialized_start=4786 + _globals['_STOREREMOVE']._serialized_end=4812 + _globals['_STOREREMOVERESULT']._serialized_start=4814 + _globals['_STOREREMOVERESULT']._serialized_end=4845 # @@protoc_insertion_point(module_scope) diff --git a/sandbox/hass_client/hass_client/_proto/sandbox_pb2.pyi b/sandbox/hass_client/hass_client/_proto/sandbox_pb2.pyi index 2b378da080d0..7ced7dd004bc 100644 --- a/sandbox/hass_client/hass_client/_proto/sandbox_pb2.pyi +++ b/sandbox/hass_client/hass_client/_proto/sandbox_pb2.pyi @@ -269,14 +269,16 @@ class Ready(_message.Message): def __init__(self) -> None: ... class FlowInit(_message.Message): - __slots__ = ("handler", "context", "data") + __slots__ = ("handler", "context", "data", "entry") HANDLER_FIELD_NUMBER: _ClassVar[int] CONTEXT_FIELD_NUMBER: _ClassVar[int] DATA_FIELD_NUMBER: _ClassVar[int] + ENTRY_FIELD_NUMBER: _ClassVar[int] handler: str context: bytes data: bytes - def __init__(self, handler: _Optional[str] = ..., context: _Optional[bytes] = ..., data: _Optional[bytes] = ...) -> None: ... + entry: EntrySetup + def __init__(self, handler: _Optional[str] = ..., context: _Optional[bytes] = ..., data: _Optional[bytes] = ..., entry: _Optional[_Union[EntrySetup, _Mapping]] = ...) -> None: ... class FlowStep(_message.Message): __slots__ = ("flow_id", "user_input") diff --git a/sandbox/hass_client/hass_client/flow_runner.py b/sandbox/hass_client/hass_client/flow_runner.py index 3ae9dd435791..6e2490cad2da 100644 --- a/sandbox/hass_client/hass_client/flow_runner.py +++ b/sandbox/hass_client/hass_client/flow_runner.py @@ -53,6 +53,7 @@ from homeassistant.helpers.service_info.zeroconf import ZeroconfServiceInfo from ._proto import sandbox_pb2 as pb from .channel import Channel +from .entry_runner import _entry_from_proto from .messages import ( MSG_FLOW_ABORT, MSG_FLOW_INIT, @@ -180,11 +181,26 @@ class FlowRunner: # dicts (the proxy flattened the *ServiceInfo / DiscoveryKey objects); # rebuild the real types so async_step_ sees what it expects. context, data = _rehydrate_discovery(context, data) + # Reauth / reconfigure / reset flows resolve the entry they operate on + # via ConfigFlow._get_reauth_entry() / _get_reconfigure_entry(), which + # look it up on this private hass. Main owns the entry, so seed a copy + # before the flow runs or those lookups raise UnknownEntry. + if msg.HasField("entry"): + self._ensure_flow_entry(msg.entry) result = await self.hass.config_entries.flow.async_init( msg.handler, context=context, data=data ) return _marshal_result(result, self.hass.config_entries.flow) + + def _ensure_flow_entry(self, entry_msg: pb.EntrySetup) -> None: + """Seed the private config_entries with the flow's target entry.""" + config_entries = self.hass.config_entries + if config_entries.async_get_entry(entry_msg.entry_id) is not None: + return + entry = _entry_from_proto(entry_msg) + config_entries._entries[entry.entry_id] = entry # noqa: SLF001 + async def _handle_flow_step(self, msg: pb.FlowStep) -> pb.FlowResult: user_input = ( decode_json_dict(msg.user_input) if msg.HasField("user_input") else None diff --git a/sandbox/hass_client/hass_client/messages.py b/sandbox/hass_client/hass_client/messages.py index c90766002188..34ad9fa58561 100644 --- a/sandbox/hass_client/hass_client/messages.py +++ b/sandbox/hass_client/hass_client/messages.py @@ -328,6 +328,28 @@ def make_entity_description( return msg +def entry_to_setup_proto(entry: Any) -> pb.EntrySetup: + """Serialise the entry-identity fields of a ConfigEntry into EntrySetup. + + Shared by the entry_setup payload and the flow proxy's reauth/reconfigure + entry carry — only the fields the sandbox needs to rebuild the entry + (integration_source / core_config are filled separately by entry_setup). + """ + msg = pb.EntrySetup( + entry_id=entry.entry_id, + domain=entry.domain, + title=entry.title, + data=encode_json(dict(entry.data)), + options=encode_json(dict(entry.options)), + source=entry.source, + version=entry.version, + minor_version=entry.minor_version, + ) + if entry.unique_id is not None: + msg.unique_id = entry.unique_id + return msg + + def core_config_to_proto(config: Any) -> pb.CoreConfig: """Snapshot a hass ``Config`` into the wire ``CoreConfig`` message. diff --git a/sandbox/hass_client/tests/test_flow_runner.py b/sandbox/hass_client/tests/test_flow_runner.py index 4a2fc30bd761..c9e8a0913ac1 100644 --- a/sandbox/hass_client/tests/test_flow_runner.py +++ b/sandbox/hass_client/tests/test_flow_runner.py @@ -407,3 +407,76 @@ async def test_flow_abort_is_idempotent( # FlowAbortResult is an empty message (was `result == {}` on the dict wire). assert isinstance(result, pb.FlowAbortResult) assert result.SerializeToString() == b"" + + +class _ReconfigureFlow(ConfigFlow, domain="phase4_reconfigure"): + """Flow whose reconfigure step reads the entry it operates on.""" + + VERSION = 1 + + async def async_step_reconfigure( + self, user_input: dict[str, Any] | None = None + ) -> ConfigFlowResult: + # Raises UnknownEntry on the private hass unless flow_init seeded the + # entry — the whole point of the FlowInit.entry carry. + entry = self._get_reconfigure_entry() + return self.async_show_form( + step_id="reconfigure", + description_placeholders={"title": entry.title}, + ) + + +async def test_flow_init_seeds_reconfigure_entry( + channels: tuple[Channel, Channel], runner: FlowRunner +) -> None: + """FlowInit.entry lets a reconfigure flow resolve main's entry. + + Regression for the UnknownEntry cluster: reauth/reconfigure flows call + ``_get_reconfigure_entry()`` / ``_get_reauth_entry()`` which look the + entry up on the private hass. Main owns it, so flow_init must seed a copy. + """ + main, sandbox = channels + runner.register(sandbox) + main.start() + sandbox.start() + + ha_config_entries.HANDLERS["phase4_reconfigure"] = _ReconfigureFlow + fake_module = ModuleType("homeassistant.components.phase4_reconfigure") + fake_flow_module = ModuleType( + "homeassistant.components.phase4_reconfigure.config_flow" + ) + runner.hass.data[ha_loader.DATA_COMPONENTS]["phase4_reconfigure"] = fake_module + runner.hass.data[ha_loader.DATA_COMPONENTS][ + "phase4_reconfigure.config_flow" + ] = fake_flow_module + runner.hass.config.components.add("phase4_reconfigure") + try: + init_msg = pb.FlowInit(handler="phase4_reconfigure") + init_msg.context = encode_json( + {"source": "reconfigure", "entry_id": "reconf-entry"} + ) + init_msg.entry.CopyFrom( + pb.EntrySetup( + entry_id="reconf-entry", + domain="phase4_reconfigure", + title="Existing Device", + data=encode_json({"host": "1.2.3.4"}), + options=encode_json({}), + source="user", + version=1, + minor_version=1, + ) + ) + result = await main.call("sandbox/flow_init", init_msg) + finally: + ha_config_entries.HANDLERS.pop("phase4_reconfigure", None) + runner.hass.data[ha_loader.DATA_COMPONENTS].pop("phase4_reconfigure", None) + runner.hass.data[ha_loader.DATA_COMPONENTS].pop( + "phase4_reconfigure.config_flow", None + ) + + assert result.type == "form" + assert result.step_id == "reconfigure" + assert decode_json_dict(result.description_placeholders) == { + "title": "Existing Device" + } diff --git a/sandbox/proto/sandbox.proto b/sandbox/proto/sandbox.proto index dfd64a26d33e..b15656882810 100644 --- a/sandbox/proto/sandbox.proto +++ b/sandbox/proto/sandbox.proto @@ -239,6 +239,11 @@ message FlowInit { string handler = 1; bytes context = 2; // dynamic, JSON object optional bytes data = 3; // dynamic, JSON object (unset = no initial data) + // The entry a reauth / reconfigure / reset flow operates on. Main owns the + // ConfigEntry; the sandbox-private flow manager needs a copy so + // ConfigFlow._get_reauth_entry() / _get_reconfigure_entry() resolve instead + // of raising UnknownEntry. Unset for a plain user / discovery flow. + optional EntrySetup entry = 4; } message FlowStep { diff --git a/tests/components/sandbox/test_proxy_flow.py b/tests/components/sandbox/test_proxy_flow.py index 4f2b86bbe3cb..2a1de3fe776a 100644 --- a/tests/components/sandbox/test_proxy_flow.py +++ b/tests/components/sandbox/test_proxy_flow.py @@ -16,7 +16,11 @@ from homeassistant.components.sandbox.manager import SandboxManager from homeassistant.components.sandbox.messages import decode_json_dict, encode_json from homeassistant.components.sandbox.proxy_flow import SandboxFlowProxy from homeassistant.components.sandbox.router import SandboxFlowRouter -from homeassistant.config_entries import SOURCE_USER, ConfigEntryState +from homeassistant.config_entries import ( + SOURCE_RECONFIGURE, + SOURCE_USER, + ConfigEntryState, +) from homeassistant.core import HomeAssistant from homeassistant.data_entry_flow import FlowResultType from homeassistant.helpers.discovery_flow import DiscoveryKey @@ -24,7 +28,7 @@ from homeassistant.helpers.service_info.zeroconf import ZeroconfServiceInfo from ._helpers import FakeSandboxManager, make_channel_pair -from tests.common import MockModule, mock_integration +from tests.common import MockConfigEntry, MockModule, mock_integration class _SandboxStub: @@ -479,6 +483,54 @@ async def test_discovery_flow_marshals_service_info( assert "host" not in data +async def test_reconfigure_flow_carries_entry( + hass: HomeAssistant, manager: FakeSandboxManager +) -> None: + """A reconfigure flow ships main's entry so the sandbox can resolve it. + + Regression for the UnknownEntry cluster: without ``FlowInit.entry`` the + sandbox flow's ``_get_reconfigure_entry()`` raises on the private hass. + """ + mock_integration(hass, MockModule("test_proxy_reconf")) + entry = MockConfigEntry( + domain="test_proxy_reconf", + title="Existing", + data={"host": "1.2.3.4"}, + sandbox="built-in", + entry_id="reconf-1", + ) + entry.add_to_hass(hass) + responses = [ + pb.FlowResult( + type=FlowResultType.FORM.value, + flow_id="sandbox-reconf-1", + handler="test_proxy_reconf", + step_id="reconfigure", + ), + ] + + with ( + _wired_sandbox(manager, group="built-in", responses=responses) as stub, + patch( + "homeassistant.components.sandbox.router.classify", + return_value=type("A", (), {"is_main": False, "group": "built-in"})(), + ), + ): + await _install_router(hass, manager) + result = await hass.config_entries.flow.async_init( + "test_proxy_reconf", + context={"source": SOURCE_RECONFIGURE, "entry_id": entry.entry_id}, + ) + assert result["type"] is FlowResultType.FORM + + assert len(stub.init_calls) == 1 + init = stub.init_calls[0] + assert init.HasField("entry") + assert init.entry.entry_id == "reconf-1" + assert init.entry.title == "Existing" + assert decode_json_dict(init.entry.data) == {"host": "1.2.3.4"} + + async def _install_router(hass: HomeAssistant, manager: FakeSandboxManager) -> None: """Attach a router that uses ``manager`` to ``hass.config_entries``.""" router = SandboxFlowRouter(hass, cast(SandboxManager, manager))