Closed claytonjn closed 4 years ago
I've got a pull request started here: https://github.com/custom-components/weatheralerts/pull/29
that adds those additional properties. It also allows zone or county ID number to be specified and later today I'll push a commit that adds PlatformNotReady to allow the component to retry the setup if weather.gov request fails during the first setup try.
The latest release of weatheralerts contains several additional alert properties. The full list:
sensor attribute | alert property |
---|---|
area | areaDesc |
certainty | certainty |
description | description |
ends | ends |
event | event |
instruction | instruction |
response | response |
sent | sent |
severity | severity |
title | headline (everything before ' by ') |
urgency | urgency |
NWSheadline | parameters:NWSheadline |
effective | effective |
expires | expires |
onset | onset |
status | status |
messageType | messageType |
category | category |
sender | sender |
senderName | senderName |
id | id |
zoneid | feedid (passed to alert api URL) |
I kept 'area' instead of renaming it to 'areaDesc' so it wouldn't break any existing configurations. I changed 'title' to add the issued date and time. If that isn't desired, 'event' can be used instead of 'title'. The 'zoneid' is set to equal the full 6 character zone ID or a comma separated list of the 6 character zone and county ID's that are passed to the weather.gov alert api URL.
I didn't think any of the other alert properties were particularly useful. If you disagree, feel free to comment on which additional properties you think would be useful and I'll get them in there.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Is your feature request related to a problem? Please describe. I would like additional properties exposed -
effective
,expires
, andNWSheadline
.Describe the solution you'd like I can submit a PR, but I'd like to know which option below you'd prefer.
Describe alternatives you've considered
They're both minor changes and I tested both without issues. I personally think option 2 would be better because it doesn't limit anything from the end-user, however it would be a breaking change -
area
would becomeareaDesc
, andtitle
would go away (from my limited testing the "generated" title seems to be the same as event).Additional context
ends
is None in my testing, butexpires
does have a datetime.NWSheadline
is perfect for a broadcast message because it's a good concise description of the alert that won't get truncated.