[feed] Added Channel for link to feed item; Updated rome library to version 1.15 (#8893)
* Added Channel for link to latest feed; update rome deoendency to version 1.15 * Removed unsed interface * Run spotless Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
This commit is contained in:
committed by
GitHub
parent
9a5832a2ee
commit
1e89b792a0
@@ -41,10 +41,15 @@ public class FeedBindingConstants {
|
||||
public static final String CHANNEL_LATEST_TITLE = "latest-title";
|
||||
|
||||
/**
|
||||
* Contains the description of last feed entry.
|
||||
* Contains the description of the last feed entry.
|
||||
*/
|
||||
public static final String CHANNEL_LATEST_DESCRIPTION = "latest-description";
|
||||
|
||||
/**
|
||||
* Contains the link to the last feed entry.
|
||||
*/
|
||||
public static final String CHANNEL_LATEST_LINK = "latest-link";
|
||||
|
||||
/**
|
||||
* Description of the feed.
|
||||
*/
|
||||
|
||||
@@ -162,6 +162,13 @@ public class FeedHandler extends BaseThingHandler {
|
||||
state = new StringType(getValueSafely(description));
|
||||
}
|
||||
break;
|
||||
case CHANNEL_LATEST_LINK:
|
||||
if (latestEntry == null || latestEntry.getLink() == null) {
|
||||
state = UnDefType.UNDEF;
|
||||
} else {
|
||||
state = new StringType(getValueSafely(latestEntry.getLink()));
|
||||
}
|
||||
break;
|
||||
case CHANNEL_LATEST_PUBLISHED_DATE:
|
||||
case CHANNEL_LAST_UPDATE:
|
||||
if (latestEntry == null || latestEntry.getPublishedDate() == null) {
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
<channel id="latest-title" typeId="latest-title"/>
|
||||
<channel id="latest-description" typeId="latest-description"/>
|
||||
<channel id="latest-date" typeId="latest-date"/>
|
||||
<channel id="latest-link" typeId="latest-link"/>
|
||||
<channel id="author" typeId="author"/>
|
||||
<channel id="description" typeId="description"/>
|
||||
<channel id="title" typeId="title"/>
|
||||
@@ -52,7 +53,7 @@
|
||||
<channel-type id="latest-description">
|
||||
<item-type>String</item-type>
|
||||
<label>Latest Description</label>
|
||||
<description>Contains the description of last feed entry.</description>
|
||||
<description>Contains the description of the last feed entry.</description>
|
||||
<state readOnly="true" pattern="%s"/>
|
||||
</channel-type>
|
||||
|
||||
@@ -63,6 +64,13 @@
|
||||
<state readOnly="true" pattern="%tc %n"/>
|
||||
</channel-type>
|
||||
|
||||
<channel-type id="latest-link">
|
||||
<item-type>String</item-type>
|
||||
<label>Latest Link</label>
|
||||
<description>Contains the link of the last feed entry.</description>
|
||||
<state readOnly="true" pattern="%s"/>
|
||||
</channel-type>
|
||||
|
||||
<channel-type id="author" advanced="true">
|
||||
<item-type>String</item-type>
|
||||
<label>Author</label>
|
||||
|
||||
Reference in New Issue
Block a user