Skip to content

Instantly share code, notes, and snippets.

@pavolholes
pavolholes / automations.yaml
Last active March 13, 2023 20:10
Home Assistant Notifikacia Senzory maju problem
- id: '1673221013583'
alias: Home Assistant Notifikacia Senzory maju problem
description: ''
trigger:
- platform: state
entity_id:
- sensor.senzory_s_problemom_pocet
condition:
- condition: template
value_template: '{{ trigger.from_state.state != ''unavailable'' }}'
@bekarice
bekarice / wc-memberships-renew-with-purchase.php
Last active March 11, 2022 01:36
WooCommerce Memberships: Change a Renewal Link to Purchase a Different Membership
<?php
// Changes the renewal link for a particular membership to purchase a new one
// Old membership will be deleted upon purchase if expired
/**
* Changes the renewal URL for the trial membership
*
* @param string $url the renewal URL
* @param \WC_Memberships_User_Membership $membership the user membership
* @return string $url the updated renewal URL