home_assistant-generator 0.1.0.pre.alpha.pre.15 → 0.1.0.pre.alpha.pre.16
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c2eb391bd803fa114fd12d0a348aa7ffa0890d5e
|
4
|
+
data.tar.gz: 0e35575e164c6ea2159db9d2a3b10ff9dc0a73e7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: afe65f955631ad4f44e223c3f9b8f9b1cd09e81ce3867fbd292d37bebb706540015ab90d0a4e4ec3b4b87350213f3814cd66e1592620645f011f15b674b12bf1
|
7
|
+
data.tar.gz: b9e2903cf8154135b561d165e65fe9138549cb0ca3efb7012058da58bdf5993a53628a10a7556cc3473b642f30ae6511edc3f7e0825f7247c931b7f8d4a80aa7
|
@@ -1,3 +1,5 @@
|
|
1
|
+
require 'active_support/inflector'
|
2
|
+
|
1
3
|
module HomeAssistant
|
2
4
|
module Generator
|
3
5
|
# using default Component class behavior would lead to write:
|
@@ -23,18 +25,22 @@ module HomeAssistant
|
|
23
25
|
# command_on '...'
|
24
26
|
# command_off '...'
|
25
27
|
# end
|
26
|
-
class
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
28
|
+
class PluralComponent < Component
|
29
|
+
def name(value)
|
30
|
+
@element_name = value
|
31
|
+
end
|
32
|
+
|
33
|
+
def platform(value)
|
34
|
+
@platform = value
|
35
|
+
end
|
34
36
|
|
35
|
-
|
36
|
-
|
37
|
-
|
37
|
+
def to_h
|
38
|
+
plural = self.class.name.downcase.split('::').last.pluralize
|
39
|
+
{ 'platform' => @platform, plural => { @element_name => super } }
|
40
|
+
end
|
41
|
+
end
|
42
|
+
class DSL
|
43
|
+
class Switch < PluralComponent
|
38
44
|
end
|
39
45
|
end
|
40
46
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: home_assistant-generator
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.0.pre.alpha.pre.
|
4
|
+
version: 0.1.0.pre.alpha.pre.16
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Grégoire Seux
|
@@ -66,6 +66,20 @@ dependencies:
|
|
66
66
|
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: activesupport
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :runtime
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
69
83
|
description:
|
70
84
|
email:
|
71
85
|
- grego_homeassistant@familleseux.net
|
@@ -89,8 +103,8 @@ files:
|
|
89
103
|
- lib/home_assistant/generator/automation.rb
|
90
104
|
- lib/home_assistant/generator/component.rb
|
91
105
|
- lib/home_assistant/generator/dsl.rb
|
106
|
+
- lib/home_assistant/generator/plural.rb
|
92
107
|
- lib/home_assistant/generator/properties.rb
|
93
|
-
- lib/home_assistant/generator/switch.rb
|
94
108
|
- lib/home_assistant/generator/version.rb
|
95
109
|
homepage:
|
96
110
|
licenses:
|