Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support image entity in camera widget (now renamed picture widget) #4159

Merged
merged 1 commit into from
Jan 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ import io.homeassistant.companion.android.widgets.template.TemplateWidgetConfigu

enum class WidgetType(val widgetIcon: IIcon) {
BUTTON(CommunityMaterial.Icon2.cmd_gesture_tap),
CAMERA(CommunityMaterial.Icon.cmd_camera),
CAMERA(CommunityMaterial.Icon.cmd_camera_image),
STATE(CommunityMaterial.Icon3.cmd_shape),
MEDIA(CommunityMaterial.Icon3.cmd_play_box_multiple),
TEMPLATE(CommunityMaterial.Icon.cmd_code_braces);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ class CameraWidgetConfigureActivity : BaseWidgetConfigureActivity() {
lifecycleScope.launch {
try {
val fetchedEntities = serverManager.integrationRepository(server.id).getEntities().orEmpty()
.filter { it.domain == "camera" }
.filter { it.domain == "camera" || it.domain == "image" }
entities[server.id] = fetchedEntities
if (server.id == selectedServerId) setAdapterEntities(server.id)
} catch (e: Exception) {
Expand Down
8 changes: 4 additions & 4 deletions common/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,8 @@
<string name="camera_tile_no_entity_yet">Edit the tile settings and select a camera to show</string>
<string name="camera_tile_n">Camera tile #%d</string>
<string name="camera_tiles">Camera tiles</string>
<string name="camera_widgets">Camera widgets</string>
<string name="camera_widget_desc">Displays the latest image from the camera</string>
<string name="camera_widgets">Picture widgets</string>
<string name="camera_widget_desc">Displays the latest picture from a camera or image entity</string>
<string name="cancel">Cancel</string>
<string name="changelog">View full change log</string>
<string name="checking_with_home_assistant">Checking with Home Assistant</string>
Expand Down Expand Up @@ -974,8 +974,8 @@
<string name="widget_background_type_dynamiccolor">Dynamic color</string>
<string name="widget_background_type_transparent">Transparent</string>
<string name="widget_button_image_description">Service button</string>
<string name="widget_camera_description">Camera widget</string>
<string name="widget_camera_contentdescription">Camera image</string>
<string name="widget_camera_description">Picture widget</string>
<string name="widget_camera_contentdescription">Image</string>
<string name="widget_config_service_error">A custom component is preventing service data from loading.</string>
<string name="widget_creation_error">Unable to create widget.</string>
<string name="widget_entity_fetch_error">Unable to fetch data for configured entity.</string>
Expand Down
Loading