Skip to content

Commit

Permalink
Support image entity in camera widget (now renamed picture widget) (#…
Browse files Browse the repository at this point in the history
…4159)

- Allow selecting image entities in the camera widget
 - Rename camera widget to picture widget to better reflect camera + image entity support
  • Loading branch information
jpelgrom authored Jan 25, 2024
1 parent ef17312 commit c6ddca8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
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

0 comments on commit c6ddca8

Please sign in to comment.