# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: device.proto

import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
from google.protobuf import descriptor_pb2
# @@protoc_insertion_point(imports)

_sym_db = _symbol_database.Default()




DESCRIPTOR = _descriptor.FileDescriptor(
  name='device.proto',
  package='device',
  syntax='proto3',
  serialized_pb=_b('\n\x0c\x64\x65vice.proto\x12\x06\x64\x65vice\"\x07\n\x05\x45mpty\"\x18\n\x06\x44\x65vice\x12\x0e\n\x06\x64\x65vice\x18\x01 \x01(\t\".\n\x0bTemperature\x12\x0e\n\x06\x64\x65vice\x18\x01 \x01(\t\x12\x0f\n\x07\x63\x65lcius\x18\x02 \x01(\x02\".\n\x10\x45lectricityUsage\x12\x0e\n\x06\x64\x65vice\x18\x01 \x01(\t\x12\n\n\x02kw\x18\x02 \x01(\x03\"&\n\x08GasUsage\x12\x0e\n\x06\x64\x65vice\x18\x01 \x01(\t\x12\n\n\x02m3\x18\x02 \x01(\x03\x32\x89\x01\n\x12TemperatureService\x12\x37\n\x0fset_temperature\x12\x13.device.Temperature\x1a\r.device.Empty\"\x00\x12:\n\x0fget_temperature\x12\x0e.device.Device\x1a\x13.device.Temperature\"\x00\x30\x01\x32\x8c\x01\n\x0cUsageService\x12\x45\n\x18latest_electricity_usage\x12\x18.device.ElectricityUsage\x1a\r.device.Empty\"\x00\x12\x35\n\x10latest_gas_usage\x12\x10.device.GasUsage\x1a\r.device.Empty\"\x00\x42\x0f\n\x07\x65x.grpc\xa2\x02\x03HSWb\x06proto3')
)
_sym_db.RegisterFileDescriptor(DESCRIPTOR)




_EMPTY = _descriptor.Descriptor(
  name='Empty',
  full_name='device.Empty',
  filename=None,
  file=DESCRIPTOR,
  containing_type=None,
  fields=[
  ],
  extensions=[
  ],
  nested_types=[],
  enum_types=[
  ],
  options=None,
  is_extendable=False,
  syntax='proto3',
  extension_ranges=[],
  oneofs=[
  ],
  serialized_start=24,
  serialized_end=31,
)


_DEVICE = _descriptor.Descriptor(
  name='Device',
  full_name='device.Device',
  filename=None,
  file=DESCRIPTOR,
  containing_type=None,
  fields=[
    _descriptor.FieldDescriptor(
      name='device', full_name='device.Device.device', index=0,
      number=1, type=9, cpp_type=9, label=1,
      has_default_value=False, default_value=_b("").decode('utf-8'),
      message_type=None, enum_type=None, containing_type=None,
      is_extension=False, extension_scope=None,
      options=None),
  ],
  extensions=[
  ],
  nested_types=[],
  enum_types=[
  ],
  options=None,
  is_extendable=False,
  syntax='proto3',
  extension_ranges=[],
  oneofs=[
  ],
  serialized_start=33,
  serialized_end=57,
)


_TEMPERATURE = _descriptor.Descriptor(
  name='Temperature',
  full_name='device.Temperature',
  filename=None,
  file=DESCRIPTOR,
  containing_type=None,
  fields=[
    _descriptor.FieldDescriptor(
      name='device', full_name='device.Temperature.device', index=0,
      number=1, type=9, cpp_type=9, label=1,
      has_default_value=False, default_value=_b("").decode('utf-8'),
      message_type=None, enum_type=None, containing_type=None,
      is_extension=False, extension_scope=None,
      options=None),
    _descriptor.FieldDescriptor(
      name='celcius', full_name='device.Temperature.celcius', index=1,
      number=2, type=2, cpp_type=6, label=1,
      has_default_value=False, default_value=float(0),
      message_type=None, enum_type=None, containing_type=None,
      is_extension=False, extension_scope=None,
      options=None),
  ],
  extensions=[
  ],
  nested_types=[],
  enum_types=[
  ],
  options=None,
  is_extendable=False,
  syntax='proto3',
  extension_ranges=[],
  oneofs=[
  ],
  serialized_start=59,
  serialized_end=105,
)


_ELECTRICITYUSAGE = _descriptor.Descriptor(
  name='ElectricityUsage',
  full_name='device.ElectricityUsage',
  filename=None,
  file=DESCRIPTOR,
  containing_type=None,
  fields=[
    _descriptor.FieldDescriptor(
      name='device', full_name='device.ElectricityUsage.device', index=0,
      number=1, type=9, cpp_type=9, label=1,
      has_default_value=False, default_value=_b("").decode('utf-8'),
      message_type=None, enum_type=None, containing_type=None,
      is_extension=False, extension_scope=None,
      options=None),
    _descriptor.FieldDescriptor(
      name='kw', full_name='device.ElectricityUsage.kw', index=1,
      number=2, type=3, cpp_type=2, label=1,
      has_default_value=False, default_value=0,
      message_type=None, enum_type=None, containing_type=None,
      is_extension=False, extension_scope=None,
      options=None),
  ],
  extensions=[
  ],
  nested_types=[],
  enum_types=[
  ],
  options=None,
  is_extendable=False,
  syntax='proto3',
  extension_ranges=[],
  oneofs=[
  ],
  serialized_start=107,
  serialized_end=153,
)


_GASUSAGE = _descriptor.Descriptor(
  name='GasUsage',
  full_name='device.GasUsage',
  filename=None,
  file=DESCRIPTOR,
  containing_type=None,
  fields=[
    _descriptor.FieldDescriptor(
      name='device', full_name='device.GasUsage.device', index=0,
      number=1, type=9, cpp_type=9, label=1,
      has_default_value=False, default_value=_b("").decode('utf-8'),
      message_type=None, enum_type=None, containing_type=None,
      is_extension=False, extension_scope=None,
      options=None),
    _descriptor.FieldDescriptor(
      name='m3', full_name='device.GasUsage.m3', index=1,
      number=2, type=3, cpp_type=2, label=1,
      has_default_value=False, default_value=0,
      message_type=None, enum_type=None, containing_type=None,
      is_extension=False, extension_scope=None,
      options=None),
  ],
  extensions=[
  ],
  nested_types=[],
  enum_types=[
  ],
  options=None,
  is_extendable=False,
  syntax='proto3',
  extension_ranges=[],
  oneofs=[
  ],
  serialized_start=155,
  serialized_end=193,
)

DESCRIPTOR.message_types_by_name['Empty'] = _EMPTY
DESCRIPTOR.message_types_by_name['Device'] = _DEVICE
DESCRIPTOR.message_types_by_name['Temperature'] = _TEMPERATURE
DESCRIPTOR.message_types_by_name['ElectricityUsage'] = _ELECTRICITYUSAGE
DESCRIPTOR.message_types_by_name['GasUsage'] = _GASUSAGE

Empty = _reflection.GeneratedProtocolMessageType('Empty', (_message.Message,), dict(
  DESCRIPTOR = _EMPTY,
  __module__ = 'device_pb2'
  # @@protoc_insertion_point(class_scope:device.Empty)
  ))
_sym_db.RegisterMessage(Empty)

Device = _reflection.GeneratedProtocolMessageType('Device', (_message.Message,), dict(
  DESCRIPTOR = _DEVICE,
  __module__ = 'device_pb2'
  # @@protoc_insertion_point(class_scope:device.Device)
  ))
_sym_db.RegisterMessage(Device)

Temperature = _reflection.GeneratedProtocolMessageType('Temperature', (_message.Message,), dict(
  DESCRIPTOR = _TEMPERATURE,
  __module__ = 'device_pb2'
  # @@protoc_insertion_point(class_scope:device.Temperature)
  ))
_sym_db.RegisterMessage(Temperature)

ElectricityUsage = _reflection.GeneratedProtocolMessageType('ElectricityUsage', (_message.Message,), dict(
  DESCRIPTOR = _ELECTRICITYUSAGE,
  __module__ = 'device_pb2'
  # @@protoc_insertion_point(class_scope:device.ElectricityUsage)
  ))
_sym_db.RegisterMessage(ElectricityUsage)

GasUsage = _reflection.GeneratedProtocolMessageType('GasUsage', (_message.Message,), dict(
  DESCRIPTOR = _GASUSAGE,
  __module__ = 'device_pb2'
  # @@protoc_insertion_point(class_scope:device.GasUsage)
  ))
_sym_db.RegisterMessage(GasUsage)


DESCRIPTOR.has_options = True
DESCRIPTOR._options = _descriptor._ParseOptions(descriptor_pb2.FileOptions(), _b('\n\007ex.grpc\242\002\003HSW'))
import grpc
from grpc.beta import implementations as beta_implementations
from grpc.beta import interfaces as beta_interfaces
from grpc.framework.common import cardinality
from grpc.framework.interfaces.face import utilities as face_utilities


class TemperatureServiceStub(object):

  def __init__(self, channel):
    """Constructor.

    Args:
      channel: A grpc.Channel.
    """
    self.set_temperature = channel.unary_unary(
        '/device.TemperatureService/set_temperature',
        request_serializer=Temperature.SerializeToString,
        response_deserializer=Empty.FromString,
        )
    self.get_temperature = channel.unary_stream(
        '/device.TemperatureService/get_temperature',
        request_serializer=Device.SerializeToString,
        response_deserializer=Temperature.FromString,
        )


class TemperatureServiceServicer(object):

  def set_temperature(self, request, context):
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def get_temperature(self, request, context):
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')


def add_TemperatureServiceServicer_to_server(servicer, server):
  rpc_method_handlers = {
      'set_temperature': grpc.unary_unary_rpc_method_handler(
          servicer.set_temperature,
          request_deserializer=Temperature.FromString,
          response_serializer=Empty.SerializeToString,
      ),
      'get_temperature': grpc.unary_stream_rpc_method_handler(
          servicer.get_temperature,
          request_deserializer=Device.FromString,
          response_serializer=Temperature.SerializeToString,
      ),
  }
  generic_handler = grpc.method_handlers_generic_handler(
      'device.TemperatureService', rpc_method_handlers)
  server.add_generic_rpc_handlers((generic_handler,))


class BetaTemperatureServiceServicer(object):
  def set_temperature(self, request, context):
    context.code(beta_interfaces.StatusCode.UNIMPLEMENTED)
  def get_temperature(self, request, context):
    context.code(beta_interfaces.StatusCode.UNIMPLEMENTED)


class BetaTemperatureServiceStub(object):
  def set_temperature(self, request, timeout, metadata=None, with_call=False, protocol_options=None):
    raise NotImplementedError()
  set_temperature.future = None
  def get_temperature(self, request, timeout, metadata=None, with_call=False, protocol_options=None):
    raise NotImplementedError()


def beta_create_TemperatureService_server(servicer, pool=None, pool_size=None, default_timeout=None, maximum_timeout=None):
  request_deserializers = {
    ('device.TemperatureService', 'get_temperature'): Device.FromString,
    ('device.TemperatureService', 'set_temperature'): Temperature.FromString,
  }
  response_serializers = {
    ('device.TemperatureService', 'get_temperature'): Temperature.SerializeToString,
    ('device.TemperatureService', 'set_temperature'): Empty.SerializeToString,
  }
  method_implementations = {
    ('device.TemperatureService', 'get_temperature'): face_utilities.unary_stream_inline(servicer.get_temperature),
    ('device.TemperatureService', 'set_temperature'): face_utilities.unary_unary_inline(servicer.set_temperature),
  }
  server_options = beta_implementations.server_options(request_deserializers=request_deserializers, response_serializers=response_serializers, thread_pool=pool, thread_pool_size=pool_size, default_timeout=default_timeout, maximum_timeout=maximum_timeout)
  return beta_implementations.server(method_implementations, options=server_options)


def beta_create_TemperatureService_stub(channel, host=None, metadata_transformer=None, pool=None, pool_size=None):
  request_serializers = {
    ('device.TemperatureService', 'get_temperature'): Device.SerializeToString,
    ('device.TemperatureService', 'set_temperature'): Temperature.SerializeToString,
  }
  response_deserializers = {
    ('device.TemperatureService', 'get_temperature'): Temperature.FromString,
    ('device.TemperatureService', 'set_temperature'): Empty.FromString,
  }
  cardinalities = {
    'get_temperature': cardinality.Cardinality.UNARY_STREAM,
    'set_temperature': cardinality.Cardinality.UNARY_UNARY,
  }
  stub_options = beta_implementations.stub_options(host=host, metadata_transformer=metadata_transformer, request_serializers=request_serializers, response_deserializers=response_deserializers, thread_pool=pool, thread_pool_size=pool_size)
  return beta_implementations.dynamic_stub(channel, 'device.TemperatureService', cardinalities, options=stub_options)


class UsageServiceStub(object):

  def __init__(self, channel):
    """Constructor.

    Args:
      channel: A grpc.Channel.
    """
    self.latest_electricity_usage = channel.unary_unary(
        '/device.UsageService/latest_electricity_usage',
        request_serializer=ElectricityUsage.SerializeToString,
        response_deserializer=Empty.FromString,
        )
    self.latest_gas_usage = channel.unary_unary(
        '/device.UsageService/latest_gas_usage',
        request_serializer=GasUsage.SerializeToString,
        response_deserializer=Empty.FromString,