Skip to content

Instantly share code, notes, and snippets.

@sdague
sdague / imaway
Last active March 8, 2022 06:23
dbus xchat integration
#!/usr/bin/python
import dbus
import dbus.glib
import gobject
import subprocess
def lock():
print "Screen saver turned on"
@sdague
sdague / discover_scenes.py
Created November 21, 2016 11:53
Discover hue groups and scenes
#!/usr/bin/env python
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
"""
Support for Waterfurnace
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.waterfurnace/
"""
import asyncio
from datetime import timedelta
import json
import logging
"""
Support for Waterfurnace
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.waterfurnace/
"""
import asyncio
from datetime import timedelta
import json
import logging
diff --git a/nova/api/openstack/compute/hide_server_addresses.py b/nova/api/openstack/compute/hide_server_addresses.py
index 07f23599df..6ea55be27f 100644
--- a/nova/api/openstack/compute/hide_server_addresses.py
+++ b/nova/api/openstack/compute/hide_server_addresses.py
@@ -59,7 +59,7 @@ class Controller(wsgi.Controller):
return
if 'server' in resp.obj and 'addresses' in resp.obj['server']:
- instance = req.get_db_instance(id)
+ instance = req.get_db_instance(resp.obj['server']['id'])
<link rel="import" href="../../../bower_components/polymer/polymer.html">
<link rel="import" href="../../../bower_components/iron-icon/iron-icon.html">
<dom-module id="ha-state-icon">
<template>
<iron-icon icon="[[computeIcon(stateObj)]]"></iron-icon>
</template>
</dom-module>
import os
import json
import logging
# The domain of your component. Should be equal to the name of your component.
DOMAIN = 'hue'
_LOGGER = logging.getLogger(__name__)
_CONFIGURED_BRIDGE = None
#!/usr/bin/python
import argparse
import yaml
parser = argparse.ArgumentParser(description='Merge parameter yaml files')
parser.add_argument('files', metavar='F', nargs='+',
help='files to process')
# variables in header
x-openstack-request-id:
description: >
A unique ID for tracking the request. The request ID associated with the request
appears in the log lines for that request. By default, the middleware configuration
ensures that the request ID appears in the log files.
in: header
required: false
type: string
x-openstack-request-id_1: