homebrew-cask/Casks/home-assistant.rb

34 lines
1.2 KiB
Ruby

cask "home-assistant" do
version "2022.2,2022.345"
sha256 "e8440f775426d7b74bca232a08530e8a7f117bca1e1b16875265e9487780dbb1"
url "https://github.com/home-assistant/iOS/releases/download/release%2F#{version.csv.first}%2F#{version.csv.second}/home-assistant-mac.zip",
verified: "github.com/home-assistant/iOS/"
name "Home Assistant"
desc "Companion app for Home Assistant home automation software"
homepage "https://companion.home-assistant.io/"
# We use the GitHubLatest strategy as Home Assistant also tags pre-releases, and
# we also specify a regex since tags are unconventional, e.g. `2021.2.2/2021.55`,
# and use a custom block to replace the slash with a comma in the resulting version
livecheck do
url :url
strategy :github_latest do |page|
version = page.match(%r{href=".+/tree/(?:mac|release)/([\d.]+)/([\d.]+)"}i)
next if version.blank?
"#{version[1]},#{version[2]}"
end
end
depends_on macos: ">= :catalina"
app "Home Assistant.app"
zap trash: [
"~/Library/Application Scripts/io.robbie.HomeAssistant",
"~/Library/Containers/io.robbie.HomeAssistant",
"~/Library/Group Containers/group.io.robbie.homeassistant",
]
end